From 8f992515cddda2ac4687047b66ef780d77abf8aa Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 5 Nov 2014 20:42:20 +0100 Subject: demux_mkv: index all packets Instead of indexing only 1 packet per cluster (which is enough for working seeking), add every packet to the index. Since on seek, we go through every single index entry, this probably makes seeking slower. On the other hand, this code is used for files without index only (e.g. incomplete files), so it probably doesn't matter much. Preparation for the following commits. --- demux/demux_mkv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'demux') diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index a9230106f5..5ececb9edc 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -678,10 +678,8 @@ static void add_block_position(demuxer_t *demuxer, struct mkv_track *track, return; if (track->last_index_entry != (size_t)-1) { mkv_index_t *index = &mkv_d->indexes[track->last_index_entry]; - // filepos is always the cluster position, which can contain multiple - // blocks with different timecodes - one is enough. - // Also, never add block which are already covered by the index. - if (index->filepos == filepos || index->timecode >= timecode) + // Never add blocks which are already covered by the index. + if (index->timecode >= timecode) return; } cue_index_add(demuxer, track->tnum, filepos, timecode); -- cgit v1.2.3