mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 18:05:21 +00:00
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.
This commit is contained in:
parent
1cda73356d
commit
a77780e6be
@ -277,6 +277,17 @@ This has the following parameters:
|
||||
Above also applies for similar fields such as ``w``. These fields are
|
||||
mostly to help with user track pre-selection.
|
||||
|
||||
``flags``
|
||||
A ``+`` separated list of boolean flags. Currently defined flags:
|
||||
|
||||
``default``
|
||||
Set the default track flag.
|
||||
|
||||
``forced``
|
||||
Set the forced track flag.
|
||||
|
||||
Other values are ignored after triggering a warning.
|
||||
|
||||
``w``, ``h``
|
||||
For video codecs: expected video size. See ``codec`` for details.
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user