summaryrefslogtreecommitdiff
path: root/src/video_decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_decode.c')
-rw-r--r--src/video_decode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/video_decode.c b/src/video_decode.c
index 4a2eaf4..c1f7c5a 100644
--- a/src/video_decode.c
+++ b/src/video_decode.c
@@ -99,6 +99,7 @@ video_decode_get_frame(struct video_decode *vd, struct video_frame **frame)
struct video_frame_priv *f;
AVPacket packet;
int decoded, got_picture;
+ int ret;
f = calloc(1, sizeof *f);
if (f == NULL)
@@ -108,7 +109,10 @@ video_decode_get_frame(struct video_decode *vd, struct video_frame **frame)
do {
if (packet.data != NULL)
av_free_packet(&packet);
- if (av_read_frame(vd->fmt_ctx, &packet) < 0) {
+ ret = av_read_frame(vd->fmt_ctx, &packet);
+ if (ret < 0) {
+ if (ret == AVERROR_EOF)
+ return 0;
#if DEBUG
fprintf(stderr, "Found no video stream packet!\n");
#endif
@@ -146,7 +150,7 @@ video_decode_get_frame(struct video_decode *vd, struct video_frame **frame)
*frame = &f->base;
- return 0;
+ return 1;
}
void