X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_decoder.cc;h=0e65a6d6b272a67e2f9bdc37bb281f8114684d87;hb=c4403784febdbdd42e9c32e67fadb147f11fe566;hp=ce20997c84bcebefdc20dd2f90329155545cc505;hpb=1a719b15445a6244ce47c69157b64f1fd3377635;p=dcpomatic.git diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index ce20997c8..0e65a6d6b 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -74,6 +74,7 @@ using boost::split; using boost::optional; using boost::dynamic_pointer_cast; using dcp::Size; +using namespace dcpomatic; FFmpegDecoder::FFmpegDecoder (shared_ptr film, shared_ptr c, bool fast) : FFmpeg (c) @@ -377,6 +378,14 @@ FFmpegDecoder::seek (ContentTime time, bool accurate) AVSEEK_FLAG_BACKWARD ); + { + /* Force re-creation of filter graphs to reset them and hence to make sure + they don't have any pre-seek frames knocking about. + */ + boost::mutex::scoped_lock lm (_filter_graphs_mutex); + _filter_graphs.clear (); + } + if (video_codec_context ()) { avcodec_flush_buffers (video_codec_context()); }