diff options
author | wm4 <wm4@nowhere> | 2013-12-01 00:12:10 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-01 00:12:10 +0100 |
commit | b18f02d1ad5e5ce4031438f1cd0f1f3aaaf83003 (patch) | |
tree | b723192a213fbdb0b64a742c91bc106237e5d539 /audio | |
parent | aaddcb702ef93eac9087852202a59f91abb31433 (diff) | |
download | mpv-b18f02d1ad5e5ce4031438f1cd0f1f3aaaf83003.tar.bz2 mpv-b18f02d1ad5e5ce4031438f1cd0f1f3aaaf83003.tar.xz |
options: add options that set defaults for af/vf/ao/vo
There are some use cases for this. For example, you can use it to set
defaults of automatically inserted filters (like af_lavrresample). It's
also useful if you have a non-trivial VO configuration, and want to use
--vo to quickly change between the drivers without repeating the whole
configuration in the --vo argument.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af.c | 2 | ||||
-rw-r--r-- | audio/filter/af.h | 1 | ||||
-rw-r--r-- | audio/out/ao.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c index 2cc6389841..f4da46d141 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -204,6 +204,8 @@ static struct af_instance *af_create(struct af_stream *s, char *name, .data = talloc_zero(af, struct mp_audio), }; struct m_config *config = m_config_from_obj_desc(af, &desc); + if (m_config_apply_defaults(config, name, s->opts->af_defs) < 0) + goto error; if (m_config_initialize_obj(config, &desc, &af->priv, &args) < 0) goto error; diff --git a/audio/filter/af.h b/audio/filter/af.h index 7dee490665..77f3bb4945 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -79,7 +79,6 @@ struct af_stream { struct af_instance *last; // The user sets the input format (what the decoder outputs), and sets some // or all fields in output to the output format the AO accepts. - // See fixup_output_format(). struct mp_audio input; struct mp_audio output; struct mp_audio filter_output; diff --git a/audio/out/ao.c b/audio/out/ao.c index 50c95830c3..562689c80b 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -150,6 +150,8 @@ static struct ao *ao_create(bool probing, struct mpv_global *global, if (ao->driver->encode != !!ao->encode_lavc_ctx) goto error; struct m_config *config = m_config_from_obj_desc(ao, &desc); + if (m_config_apply_defaults(config, name, global->opts->ao_defs) < 0) + goto error; if (m_config_set_obj_params(config, args) < 0) goto error; ao->priv = config->optstruct; |