summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-15 15:22:05 +0100
committerwm4 <wm4@nowhere>2020-02-15 15:22:05 +0100
commit921f316281588165c6229bb675d84372353ac5ec (patch)
tree62b6baf86342d6eedb03f3f7be40ab38316b4881 /demux
parent64c4c59770c2f64e1ac4b78fb7bc12299df3072a (diff)
downloadmpv-921f316281588165c6229bb675d84372353ac5ec.tar.bz2
mpv-921f316281588165c6229bb675d84372353ac5ec.tar.xz
demux_edl: allow a redundant new_stream at the beginning
Normally, the first sub-stream is implicitly created. This change lets the user use more orthogonal syntax, and use a new_stream header for every sub-stream, instead of having to skip the header for the first one.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_edl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c
index 0c153874c0..655af8b0e0 100644
--- a/demux/demux_edl.c
+++ b/demux/demux_edl.c
@@ -194,7 +194,10 @@ static struct tl_root *parse_edl(bstr str, struct mp_log *log)
} else if (bstr_equals0(f_type, "no_clip")) {
tl->no_clip = true;
} else if (bstr_equals0(f_type, "new_stream")) {
- tl = add_part(root);
+ // (Special case: ignore "redundant" headers at the start for
+ // general symmetry.)
+ if (root->num_pars > 1 || tl->num_parts)
+ tl = add_part(root);
} else if (bstr_equals0(f_type, "no_chapters")) {
tl->disable_chapters = true;
} else {