aboutsummaryrefslogtreecommitdiffhomepage
path: root/demux
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2016-10-22 17:17:04 +0200
committerGravatar wm4 <wm4@nowhere>2016-10-22 17:17:04 +0200
commit3a78eefc88ecb354d1415f43bbf19d57caa31918 (patch)
treef13dd5f54b02486018a165d5050c458030e74ed6 /demux
parent1bf474e19afac869f643de0f51befdaed2872d23 (diff)
demux_mkv: don't recursively resolve timeline for opened reference files
Instead, resolve all references and so on in the top-level timeline.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c22
-rw-r--r--demux/demux.h1
-rw-r--r--demux/demux_mkv_timeline.c1
3 files changed, 14 insertions, 10 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 6041ada753..5072eb9f05 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -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;
}
diff --git a/demux/demux.h b/demux/demux.h
index 39c2600257..18f52d463d 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -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;
diff --git a/demux/demux_mkv_timeline.c b/demux/demux_mkv_timeline.c
index 30d669c77f..6e18fd2562 100644
--- a/demux/demux_mkv_timeline.c
+++ b/demux/demux_mkv_timeline.c
@@ -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;