Fix failure on 1-frame-back seek (#604).
authorCarl Hetherington <cth@carlh.net>
Sun, 14 Jun 2015 21:05:45 +0000 (22:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 14 Jun 2015 21:05:45 +0000 (22:05 +0100)
I don't know why this works, but it's what 1.x has been using;
I can't find any documentation on what AVSEEK_FLAG_BACKWARD is supposed
to mean.

src/lib/ffmpeg_decoder.cc

index 6f91922eb90e8faa786c3b8758a285277a3f3cc2..f8152b56e7629021d1a197b633cbe3d1559eaaff 100644 (file)
@@ -316,7 +316,7 @@ FFmpegDecoder::seek (ContentTime time, bool accurate)
        */
        
        ContentTime const u = time - _pts_offset;
-       av_seek_frame (_format_context, _video_stream, u.seconds() / av_q2d (_format_context->streams[_video_stream]->time_base), 0);
+       av_seek_frame (_format_context, _video_stream, u.seconds() / av_q2d (_format_context->streams[_video_stream]->time_base), AVSEEK_FLAG_BACKWARD);
 
        avcodec_flush_buffers (video_codec_context());