From 16534bbd8181a09cc56ec58f98a79b465af8a40d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 22 Jan 2014 23:44:43 +0100 Subject: demux_mkv: don't attempt to seek back when indexing Pretty worthless. This is called from the seek code, which will reinitialize these anyway. Even if seeking somehow decides to fail, the new values are still valid. One could say a failed seek (if that happens) should jump back to the original position, and thus it would be better to make sure the state is restored. But then demux_mkv_seek needs to do this correctly, including not setting up skipping to the target timestamp. But not bothering with this. --- demux/demux_mkv.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 75556d3849..29765ca3b4 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -2575,10 +2575,6 @@ static int create_index_until(struct demuxer *demuxer, uint64_t timecode) mkv_index_t *index = get_highest_index_entry(demuxer); if (!index || index->timecode * mkv_d->tc_scale < timecode) { - int64_t old_filepos = stream_tell(s); - int64_t old_cluster_start = mkv_d->cluster_start; - int64_t old_cluster_end = mkv_d->cluster_end; - uint64_t old_cluster_tc = mkv_d->cluster_tc; if (index) stream_seek(s, index->filepos); MP_VERBOSE(demuxer, "creating index until TC %" PRIu64 "\n", timecode); @@ -2596,10 +2592,6 @@ static int create_index_until(struct demuxer *demuxer, uint64_t timecode) if (index && index->timecode * mkv_d->tc_scale >= timecode) break; } - stream_seek(s, old_filepos); - mkv_d->cluster_start = old_cluster_start; - mkv_d->cluster_end = old_cluster_end; - mkv_d->cluster_tc = old_cluster_tc; } if (!mkv_d->indexes) { MP_WARN(demuxer, "no target for seek found\n"); -- cgit v1.2.3