ffmpeg: only apply last picture flush code at EOF
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 16 May 2015 21:08:09 +0000 (23:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 16 May 2015 22:34:08 +0000 (00:34 +0200)
Fixes Ticket4562

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index be8b078..6fe169a 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1270,7 +1270,7 @@ static int reap_filters(int flush)
                 if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
                     av_log(NULL, AV_LOG_WARNING,
                            "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret));
-                } else if (flush) {
+                } else if (flush && ret == AVERROR_EOF) {
                     if (filter->inputs[0]->type == AVMEDIA_TYPE_VIDEO)
                         do_video_out(of->ctx, ost, NULL, AV_NOPTS_VALUE);
                 }