summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mkv.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-15 18:18:21 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-15 18:18:21 +0200
commit721803c631c402ee7ed7aafa133c9c80702349e3 (patch)
tree2357cdd2c233a761353a4d6b43f59d5d9291141f /libmpdemux/demux_mkv.c
parent0478f1a29f8302263f2196525510decf6c2daf19 (diff)
downloadmpv-721803c631c402ee7ed7aafa133c9c80702349e3.tar.bz2
mpv-721803c631c402ee7ed7aafa133c9c80702349e3.tar.xz
demux_mkv: seek: fix bogus audio packet from earlier position
Due to a bug created back in 2006 when SimpleBlock support was added, demux_mkv demuxed one audio packet from the initial file position after a seek, then skipped the following ones until a video keyframe was found. This wasn't very noticeable earlier, but it had bad effects after the recently added -initial-audio-sync code as the extra packet with an earlier timestamp confused timing calculations and resulted in desync after seeking. Fix.
Diffstat (limited to 'libmpdemux/demux_mkv.c')
-rw-r--r--libmpdemux/demux_mkv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c
index 78bd6d30eb..358f152c16 100644
--- a/libmpdemux/demux_mkv.c
+++ b/libmpdemux/demux_mkv.c
@@ -2191,7 +2191,8 @@ static int handle_block(demuxer_t *demuxer, uint8_t *block, uint64_t length,
use_this_block = 0;
} else if (block_bref != 0)
use_this_block = 0;
- } else if (mkv_d->v_skip_to_keyframe)
+ }
+ if (mkv_d->v_skip_to_keyframe)
use_this_block = 0;
if (track->fix_i_bps && use_this_block) {