summaryrefslogtreecommitdiffstats
path: root/demux/demux_mkv_timeline.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-20 22:08:02 +0100
committerwm4 <wm4@nowhere>2015-02-20 22:08:02 +0100
commitee653b8a26dcd7b89de046fa6a13baa1c6ca7c27 (patch)
tree5228a0c40a87af9b3e37f6852f890c911c6f771c /demux/demux_mkv_timeline.c
parent1cac7d1a659faffd1514a3269edf9fcae4d357c1 (diff)
downloadmpv-ee653b8a26dcd7b89de046fa6a13baa1c6ca7c27.tar.bz2
mpv-ee653b8a26dcd7b89de046fa6a13baa1c6ca7c27.tar.xz
demux: timeline: honor quit requests
Diffstat (limited to 'demux/demux_mkv_timeline.c')
-rw-r--r--demux/demux_mkv_timeline.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/demux/demux_mkv_timeline.c b/demux/demux_mkv_timeline.c
index 71f5b16031..06dcfbe296 100644
--- a/demux/demux_mkv_timeline.c
+++ b/demux/demux_mkv_timeline.c
@@ -47,6 +47,7 @@
struct tl_ctx {
struct mp_log *log;
struct mpv_global *global;
+ struct timeline *tl;
struct demuxer *demuxer;
@@ -174,7 +175,11 @@ static bool check_file_seg(struct tl_ctx *ctx, struct demuxer ***sources,
.matroska_was_valid = &was_valid,
.disable_cache = true,
};
- struct demuxer *d = demux_open_url(filename, &params, NULL, ctx->global);
+ struct mp_cancel *cancel = ctx->tl->cancel;
+ if (mp_cancel_test(cancel))
+ return false;
+
+ struct demuxer *d = demux_open_url(filename, &params, cancel, ctx->global);
if (!d)
return false;
@@ -212,7 +217,7 @@ static bool check_file_seg(struct tl_ctx *ctx, struct demuxer ***sources,
{
free_demuxer_and_stream(d);
params.disable_cache = false;
- d = demux_open_url(filename, &params, NULL, ctx->global);
+ d = demux_open_url(filename, &params, cancel, ctx->global);
if (!d)
continue;
}
@@ -518,6 +523,7 @@ void build_ordered_chapter_timeline(struct timeline *tl)
*ctx = (struct tl_ctx){
.log = tl->log,
.global = tl->global,
+ .tl = tl,
.demuxer = demuxer,
};