From c38013bffb130fbd60c57348a15ad1d6759c1806 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Jul 2014 22:44:46 +0200 Subject: video: actually flush filter chain Frames buffered in filters weren't flushed, so on EOF, the last frames were dropped, depending on how much filters buffered. Oops. Test case: "mpv something.jpg --vf=buffer" --- player/video.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/player/video.c b/player/video.c index 09fc61fcf0..dacf1200c5 100644 --- a/player/video.c +++ b/player/video.c @@ -401,8 +401,11 @@ static int video_decode_and_filter(struct MPContext *mpctx) return r; if (d_video->waiting_decoded_mpi) d_video->decoder_output = d_video->waiting_decoded_mpi->params; - if (!d_video->waiting_decoded_mpi && (r == VD_EOF || r < 0)) + if (!d_video->waiting_decoded_mpi && (r == VD_EOF || r < 0)) { + if (vf_output_frame(vf, true) > 0) + return VD_PROGRESS; return VD_EOF; // true EOF + } } // Image will be filtered on the next iteration. -- cgit v1.2.3