ffmpeg: Use the buffer sinks poll instead of its input.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 6 Dec 2011 16:03:07 +0000 (17:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 8 Dec 2011 20:19:27 +0000 (21:19 +0100)
This fixes the case that the buffer sinks fifo contains frames which
would not show up on the poll from its input

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

index be98aff..9ba9d77 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1918,7 +1918,7 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
 
 #if CONFIG_AVFILTER
         if (ost->input_video_filter) {
-            frame_available = avfilter_poll_frame(ost->output_video_filter->inputs[0]);
+            frame_available = av_buffersink_poll_frame(ost->output_video_filter);
         }
         while (frame_available) {
             if (ost->output_video_filter) {
@@ -1951,7 +1951,7 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
                 do_video_stats(output_files[ost->file_index].ctx, ost, frame_size);
 #if CONFIG_AVFILTER
             cont:
-            frame_available = ost->output_video_filter && avfilter_poll_frame(ost->output_video_filter->inputs[0]);
+            frame_available = ost->output_video_filter && av_buffersink_poll_frame(ost->output_video_filter);
             avfilter_unref_buffer(ost->picref);
         }
 #endif