projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
b19fed9
)
Don't seek before 0 in FFmpegDecoder; fixes errors on seek close to 0.
author
Carl Hetherington
<cth@carlh.net>
Sun, 14 Jun 2015 21:52:42 +0000
(22:52 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 14 Jun 2015 21:52:42 +0000
(22:52 +0100)
src/lib/ffmpeg_decoder.cc
patch
|
blob
|
history
diff --git
a/src/lib/ffmpeg_decoder.cc
b/src/lib/ffmpeg_decoder.cc
index f8152b56e7629021d1a197b633cbe3d1559eaaff..4ca06329b116ae9561ddb3c61fa11a17416af9c2 100644
(file)
--- a/
src/lib/ffmpeg_decoder.cc
+++ b/
src/lib/ffmpeg_decoder.cc
@@
-315,7
+315,10
@@
FFmpegDecoder::seek (ContentTime time, bool accurate)
http://www.mjbshaw.com/2012/04/seeking-in-ffmpeg-know-your-timestamp.html
*/
- ContentTime const u = time - _pts_offset;
+ ContentTime u = time - _pts_offset;
+ if (u < ContentTime ()) {
+ u = ContentTime ();
+ }
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());