demux_mkv: don't recursively resolve timeline for opened reference files

Instead, resolve all references and so on in the top-level timeline.
This commit is contained in:
wm4 2016-10-22 17:17:04 +02:00
parent 1bf474e19a
commit 3a78eefc88
3 changed files with 14 additions and 10 deletions

View File

@ -1287,16 +1287,18 @@ static struct demuxer *open_given_type(struct mpv_global *global,
demux_changed(in->d_thread, DEMUX_EVENT_ALL);
demux_update(demuxer);
stream_control(demuxer->stream, STREAM_CTRL_SET_READAHEAD, &(int){false});
struct timeline *tl = timeline_load(global, log, demuxer);
if (tl) {
struct demuxer_params params2 = {0};
params2.timeline = tl;
struct demuxer *sub = open_given_type(global, log,
&demuxer_desc_timeline, stream,
&params2, DEMUX_CHECK_FORCE);
if (sub)
return sub;
timeline_destroy(tl);
if (!(params && params->disable_timeline)) {
struct timeline *tl = timeline_load(global, log, demuxer);
if (tl) {
struct demuxer_params params2 = {0};
params2.timeline = tl;
struct demuxer *sub =
open_given_type(global, log, &demuxer_desc_timeline, stream,
&params2, DEMUX_CHECK_FORCE);
if (sub)
return sub;
timeline_destroy(tl);
}
}
return demuxer;
}

View File

@ -161,6 +161,7 @@ struct demuxer_params {
int matroska_wanted_segment;
bool *matroska_was_valid;
struct timeline *timeline;
bool disable_timeline;
// -- demux_open_url() only
int stream_flags;
bool allow_capture;

View File

@ -170,6 +170,7 @@ static bool check_file_seg(struct tl_ctx *ctx, char *filename, int segment)
.matroska_wanted_uids = ctx->uids,
.matroska_wanted_segment = segment,
.matroska_was_valid = &was_valid,
.disable_timeline = true,
.disable_cache = true,
};
struct mp_cancel *cancel = ctx->tl->cancel;