diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-05 22:23:40 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-05 22:23:40 +0000 |
| commit | 72253f423319c8ff727acf3324617c206b984ae1 (patch) | |
| tree | 2247d82e938faf56c557acf1c1ca4445bbbc9caf | |
| parent | 870ab8d9295b9d4b6605e8876919d23379dc3a35 (diff) | |
Stop video filters emitting frames from the old position just
after a seek.
If this happens, we get sequences like
1. emit some video at time 60s
2. seek to 40s
3. video frame emitted from filter at 60.1s; this sets _last_video_time
in player so that frames emitted between 40s and 60s are discarded;
hence the audio buffers overflow.
Should fix #1551.
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index ce20997c8..edc0b08d1 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -377,6 +377,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()); } |
