summaryrefslogtreecommitdiffstats
path: root/libvo/video_out.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r--libvo/video_out.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index aea62ce0ab..b49e5b095f 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -36,8 +36,7 @@
#include "old_vo_wrapper.h"
#include "input/input.h"
#include "mp_fifo.h"
-
-
+#include "m_config.h"
#include "mp_msg.h"
#include "osdep/shmem.h"
@@ -258,8 +257,21 @@ const struct vo_driver *video_out_drivers[] =
};
-static int vo_preinit(struct vo *vo, const char *arg)
+static int vo_preinit(struct vo *vo, char *arg)
{
+ if (vo->driver->privsize)
+ vo->priv = talloc_zero_size(vo, vo->driver->privsize);
+ if (vo->driver->options) {
+ struct m_config *cfg = m_config_simple(vo->driver->options);
+ m_config_initialize(cfg, vo->priv);
+ char n[50];
+ int l = snprintf(n, sizeof(n), "vo/%s", vo->driver->info->short_name);
+ assert(l < sizeof(n));
+ int r = m_config_parse_suboptions(cfg, vo->priv, n, arg);
+ talloc_free(cfg);
+ if (r < 0)
+ return r;
+ }
return vo->driver->preinit(vo, arg);
}