diff options
author | wm4 <wm4@nowhere> | 2014-08-02 03:12:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-02 03:12:33 +0200 |
commit | d68a759fa4dea2701087039c58961757eb246b4f (patch) | |
tree | 07efabb3a1bf1bdcc0b80f6150f996aacf293ca6 /audio/filter/af_lavfi.c | |
parent | 0c6c2da8bcdb0f1523c0f10bc117c41057875e34 (diff) | |
download | mpv-d68a759fa4dea2701087039c58961757eb246b4f.tar.bz2 mpv-d68a759fa4dea2701087039c58961757eb246b4f.tar.xz |
Improve setting AVOptions
Use OPT_KEYVALUELIST() for all places where AVOptions are directly set
from mpv command line options. This allows escaping values, better
diagnostics (also no more "pal"), and somehow reduces code size.
Remove the old crappy option parser (av_opts.c).
Diffstat (limited to 'audio/filter/af_lavfi.c')
-rw-r--r-- | audio/filter/af_lavfi.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/audio/filter/af_lavfi.c b/audio/filter/af_lavfi.c index a565e202f4..0b7a619e56 100644 --- a/audio/filter/af_lavfi.c +++ b/audio/filter/af_lavfi.c @@ -38,8 +38,9 @@ #include "audio/fmt-conversion.h" #include "af.h" +#include "common/av_common.h" + #include "options/m_option.h" -#include "common/av_opts.h" // FFmpeg and Libav have slightly different APIs, just enough to cause us // unnecessary pain. <Expletive deleted.> @@ -62,7 +63,7 @@ struct priv { // options char *cfg_graph; - char *cfg_avopts; + char **cfg_avopts; }; static void destroy_graph(struct af_instance *af) @@ -90,11 +91,8 @@ static bool recreate_graph(struct af_instance *af, struct mp_audio *config) if (!graph) goto error; - if (parse_avopts(graph, p->cfg_avopts) < 0) { - MP_FATAL(af, "lavfi: could not set opts: '%s'\n", - p->cfg_avopts); + if (mp_set_avopts(af->log, graph, p->cfg_avopts) < 0) goto error; - } AVFilterInOut *outputs = avfilter_inout_alloc(); AVFilterInOut *inputs = avfilter_inout_alloc(); @@ -306,7 +304,7 @@ const struct af_info af_info_lavfi = { .priv_size = sizeof(struct priv), .options = (const struct m_option[]) { OPT_STRING("graph", cfg_graph, 0), - OPT_STRING("o", cfg_avopts, 0), + OPT_KEYVALUELIST("o", cfg_avopts, 0), {0} }, }; |