summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-21 14:16:26 +0100
committerwm4 <wm4@nowhere>2020-02-21 14:16:26 +0100
commita77780e6be2760d2deeaef316516b943ea29f1bc (patch)
treece450931d6b2c49b85b6fbe0b14a9301d77d7d10 /demux
parent1cda73356de49a8152475306d8af63480d0ba90f (diff)
downloadmpv-a77780e6be2760d2deeaef316516b943ea29f1bc.tar.bz2
mpv-a77780e6be2760d2deeaef316516b943ea29f1bc.tar.xz
edl: make it possible to set the track "default" flag
Also, the forced flag (and in the future, potentially a number of other flags not implemented yet). See next commit for purpose.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_edl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c
index 20e5c222e7..6deba77b9f 100644
--- a/demux/demux_edl.c
+++ b/demux/demux_edl.c
@@ -241,6 +241,17 @@ static struct tl_root *parse_edl(bstr str, struct mp_log *log)
sh->lang = get_param0(&ctx, sh, "lang");
sh->title = get_param0(&ctx, sh, "title");
sh->hls_bitrate = get_param_int(&ctx, "byterate", 0) * 8;
+ bstr flags = get_param(&ctx, "flags");
+ bstr flag;
+ while (bstr_split_tok(flags, "+", &flag, &flags) || flag.len) {
+ if (bstr_equals0(flag, "default")) {
+ sh->default_track = true;
+ } else if (bstr_equals0(flag, "forced")) {
+ sh->forced_track = true;
+ } else {
+ mp_warn(log, "Unknown flag: '%.*s'\n", BSTR_P(flag));
+ }
+ }
} else if (bstr_equals0(f_type, "delay_open")) {
struct sh_stream *sh = get_meta(tl, tl->num_sh_meta);
bstr mt = get_param(&ctx, "media_type");