summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mkv.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-08 05:18:48 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-08 18:05:12 +0200
commit0619b75cb137128a692056d40ffed088f8730da2 (patch)
tree343cbaa2221492bf69cdeef8d6c5df6dfb03d72a /libmpdemux/demux_mkv.c
parent259ab1fe2d50b9e47323447e018bc22090622e19 (diff)
downloadmpv-0619b75cb137128a692056d40ffed088f8730da2.tar.bz2
mpv-0619b75cb137128a692056d40ffed088f8730da2.tar.xz
demux_mkv: fix relative seeks without index
Relative seeks didn't add the current position as they should. Fix. Note that this had no effect in normal playback case even if the file had no index, because the "accurate_seek" logic at higher level would convert all commands to absolute seeks before calling demuxer level.
Diffstat (limited to 'libmpdemux/demux_mkv.c')
-rw-r--r--libmpdemux/demux_mkv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c
index bc9607769f..6f2d121f03 100644
--- a/libmpdemux/demux_mkv.c
+++ b/libmpdemux/demux_mkv.c
@@ -2522,12 +2522,12 @@ static void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs,
if (!(flags & SEEK_FACTOR)) { /* time in secs */
mkv_index_t *index = NULL;
stream_t *s = demuxer->stream;
- int64_t target_timecode = 0, diff, min_diff = 0xFFFFFFFFFFFFFFFLL;
+ int64_t diff, min_diff = 0xFFFFFFFFFFFFFFF;
int i;
if (!(flags & SEEK_ABSOLUTE)) /* relative seek */
- target_timecode = (int64_t) (mkv_d->last_pts * 1000.0);
- target_timecode += (int64_t) (rel_seek_secs * 1000.0);
+ rel_seek_secs += mkv_d->last_pts;
+ int64_t target_timecode = rel_seek_secs * 1000.0;
if (target_timecode < 0)
target_timecode = 0;