From 26d973ce827555619405bf62db24bf4ae12a4a90 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 30 Jul 2014 01:15:42 +0200 Subject: stream_lavf: allow setting AVOptions with --stream-lavf-o This commit also creates a private option struct for stream_lavf.c, but since I'm lazy, I'm not moving any existing options to it. --- stream/stream_lavf.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'stream') diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c index 925be8acd1..c736ade45f 100644 --- a/stream/stream_lavf.c +++ b/stream/stream_lavf.c @@ -25,6 +25,7 @@ #include "options/path.h" #include "common/msg.h" #include "common/tags.h" +#include "common/av_common.h" #include "stream.h" #include "options/m_option.h" @@ -33,6 +34,21 @@ #include "bstr/bstr.h" #include "talloc.h" +struct stream_lavf_params *stream_lavf_opts; + +#define OPT_BASE_STRUCT struct stream_lavf_params +struct stream_lavf_params { + char **avopts; +}; + +const struct m_sub_options stream_lavf_conf = { + .opts = (const m_option_t[]) { + OPT_KEYVALUELIST("stream-lavf-o", avopts, 0), + {0} + }, + .size = sizeof(struct stream_lavf_params), +}; + static int open_f(stream_t *stream); static struct mp_tags *read_icy(stream_t *stream); @@ -199,6 +215,7 @@ static int open_f(stream_t *stream) if (strlen(cust_headers)) av_dict_set(&dict, "headers", cust_headers, 0); av_dict_set(&dict, "icy", "1", 0); + mp_set_avdict(&dict, opts->stream_lavf_opts->avopts); AVIOInterruptCB cb = { .callback = interrupt_cb, -- cgit v1.2.3