diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-26 15:24:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-26 15:24:57 +0100 |
| commit | 23050047454f1c1f7aadad41bf7b05d00d8ffe7f (patch) | |
| tree | a0af4cfcce25709bcdd9c7479488bc235d9d38d2 /src/lib/ffmpeg_decoder.cc | |
| parent | 384e364f02b9a598044aff6073ea0f61c87c62b0 (diff) | |
Attempted fixes for some unimplemented timing bits.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 82c7cafd1..d5285b73a 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -519,16 +519,24 @@ FFmpegDecoder::seek (double p) return do_seek (p, false, false); } -void +bool FFmpegDecoder::seek_back () { - do_seek (last_content_time() - 2.5 / video_frame_rate(), true, true); + if (last_content_time() < 2.5) { + return true; + } + + return do_seek (last_content_time() - 2.5 / video_frame_rate(), true, true); } -void +bool FFmpegDecoder::seek_forward () { - do_seek (last_content_time() - 0.5 / video_frame_rate(), true, true); + if (last_content_time() >= (video_length() - video_frame_rate())) { + return true; + } + + return do_seek (last_content_time() - 0.5 / video_frame_rate(), true, true); } bool |
