Somewhat speculative move to allow -ve seeks, which seem to be necessary for some...
authorCarl Hetherington <cth@carlh.net>
Tue, 22 Jul 2014 13:47:30 +0000 (14:47 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 22 Jul 2014 13:47:30 +0000 (14:47 +0100)
src/lib/ffmpeg_decoder.cc

index 0e15880024f9d0a1eb3ebbbcb9246a6509b3ae79..0f2c88fc9f8ce36f06f957b8c4172f6248c2c44c 100644 (file)
@@ -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());