From f5e1b7238cb49ad77c313c0cacda4af1ce1b920f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 22 Jul 2014 14:47:30 +0100 Subject: [PATCH] Somewhat speculative move to allow -ve seeks, which seem to be necessary for some files to seek correctly to 0. --- src/lib/ffmpeg_decoder.cc | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 0e1588002..0f2c88fc9 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -296,9 +296,6 @@ FFmpegDecoder::seek (ContentTime time, bool accurate) ContentTime pre_roll = accurate ? ContentTime::from_seconds (2) : ContentTime (0); time -= pre_roll; - if (time < ContentTime (0)) { - time = ContentTime (0); - } /* XXX: it seems debatable whether PTS should be used here... http://www.mjbshaw.com/2012/04/seeking-in-ffmpeg-know-your-timestamp.html @@ -313,12 +310,6 @@ FFmpegDecoder::seek (ContentTime time, bool accurate) ); } - /* Ridiculous empirical hack */ - s--; - if (s < 0) { - s = 0; - } - av_seek_frame (_format_context, _video_stream, s, 0); avcodec_flush_buffers (video_codec_context()); -- 2.30.2