From 349b65eee2fd5590b7e511c915dcd2d3aef3960e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 8 Jun 2012 14:41:23 +0200 Subject: [PATCH 1/2] ffplay: check return code of avcodec_decode_video2() Signed-off-by: Michael Niedermayer Signed-off-by: Marton Balint --- ffplay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffplay.c b/ffplay.c index cb62614f36..01a010e0c1 100644 --- a/ffplay.c +++ b/ffplay.c @@ -1504,7 +1504,8 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke return 0; } - avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt); + if(avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt) < 0) + return -1; if (got_picture) { int ret = 1; From cb819338d1724bc92027f01a30565dd409f0d672 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 8 Jun 2012 14:41:24 +0200 Subject: [PATCH 2/2] ffplay: reset AVFrame to defaults before decoding each new frame. This fixes: ffplay -f lavfi -i cellauto This was a regression since factorizing the filter code with ffmpeg. Signed-off-by: Michael Niedermayer Signed-off-by: Marton Balint --- ffplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ffplay.c b/ffplay.c index 01a010e0c1..c8d768fb27 100644 --- a/ffplay.c +++ b/ffplay.c @@ -1668,6 +1668,7 @@ static int video_thread(void *arg) while (is->paused && !is->videoq.abort_request) SDL_Delay(10); + avcodec_get_frame_defaults(frame); ret = get_video_frame(is, frame, &pts_int, &pkt); if (ret < 0) goto the_end;