[FFmpeg-cvslog] ffplay: flush codec buffers before freeing filters

Marton Balint git at videolan.org
Sun May 27 17:32:05 CEST 2012


ffmpeg | branch: release/0.11 | Marton Balint <cus at passwd.hu> | Thu May 24 23:22:59 2012 +0200| [f6c3fe94daa41aa24a839432d87e857242a343a5] | committer: Michael Niedermayer

ffplay: flush codec buffers before freeing filters

We do this to ensure that input_get_buffer is not called from a
frame_worker_thread of a multithreaded decoder when we already freed the
filters.

Fixes occasional segfaults on video stream change.

Signed-off-by: Marton Balint <cus at passwd.hu>
(cherry picked from commit c2e8691c07ca52de7b6b00ba8f2b30c56fd786d7)

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6c3fe94daa41aa24a839432d87e857242a343a5
---

 ffplay.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/ffplay.c b/ffplay.c
index 7fb28ba..779c879 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1921,6 +1921,7 @@ static int video_thread(void *arg)
             stream_toggle_pause(is);
     }
  the_end:
+    avcodec_flush_buffers(is->video_st->codec);
 #if CONFIG_AVFILTER
     av_freep(&vfilters);
     avfilter_graph_free(&graph);



More information about the ffmpeg-cvslog mailing list