summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-30 01:15:42 +0200
committerwm4 <wm4@nowhere>2014-07-30 01:15:42 +0200
commit26d973ce827555619405bf62db24bf4ae12a4a90 (patch)
tree1b5f97301adca8ac102d6b530ebbc04d604dd47b /stream
parentda780309d707ac995941c14d1f5bbc8f1a7239b8 (diff)
downloadmpv-26d973ce827555619405bf62db24bf4ae12a4a90.tar.bz2
mpv-26d973ce827555619405bf62db24bf4ae12a4a90.tar.xz
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.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_lavf.c17
1 files changed, 17 insertions, 0 deletions
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,