[FFmpeg-devel] [PATCH 2/4] ffplay: flush codec buffers before freeing filters

Marton Balint cus at passwd.hu
Fri May 25 00:27:44 CEST 2012


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>
---
 ffplay.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index 40647ac..6bd3460 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1915,6 +1915,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);
-- 
1.7.3.4



More information about the ffmpeg-devel mailing list