summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-19 07:04:55 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:41:06 +0300
commit8ec90e5e4faba5754942c3dbc4edfc9f2b939a6a (patch)
tree3b46943bb361025afcdedbcc2dac3245a71e327b /libvo
parent5045066574743af40f0c33a76e7df745d967f75a (diff)
downloadmpv-8ec90e5e4faba5754942c3dbc4edfc9f2b939a6a.tar.bz2
mpv-8ec90e5e4faba5754942c3dbc4edfc9f2b939a6a.tar.xz
Add option pointer to vo struct
Diffstat (limited to 'libvo')
-rw-r--r--libvo/video_out.c8
-rw-r--r--libvo/video_out.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index b694cf944f..65e83e299a 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -10,6 +10,7 @@
//#include <sys/mman.h>
#include "config.h"
+#include "options.h"
#include "video_out.h"
#include "aspect.h"
#include "geometry.h"
@@ -297,8 +298,9 @@ void list_video_out(void)
mp_msg(MSGT_GLOBAL, MSGL_INFO,"\n");
}
-struct vo *init_best_video_out(char **vo_list)
+struct vo *init_best_video_out(struct MPOpts *opts)
{
+ char **vo_list = opts->video_driver_list;
int i;
struct vo *vo = malloc(sizeof *vo);
// first try the preferred drivers, with their optional subdevice param:
@@ -319,7 +321,7 @@ struct vo *init_best_video_out(char **vo_list)
const vo_info_t *info = video_driver->info;
if (!strcmp(info->short_name, name)) {
// name matches, try it
- memset(vo, 0, sizeof *vo);
+ *vo = (struct vo){.opts = opts};
vo->driver = video_driver;
if (!vo_preinit(vo, vo_subdevice)) {
free(name);
@@ -337,7 +339,7 @@ struct vo *init_best_video_out(char **vo_list)
vo_subdevice = NULL;
for (i = 0; video_out_drivers[i]; i++) {
const struct vo_driver *video_driver = video_out_drivers[i];
- memset(vo, 0, sizeof *vo);
+ *vo = (struct vo){.opts = opts};
vo->driver = video_driver;
if (!vo_preinit(vo, vo_subdevice))
return vo; // success!
diff --git a/libvo/video_out.h b/libvo/video_out.h
index c22c0a5102..3a67a1983a 100644
--- a/libvo/video_out.h
+++ b/libvo/video_out.h
@@ -209,9 +209,10 @@ struct vo_old_functions {
struct vo {
const struct vo_driver *driver;
void *priv;
+ struct MPOpts *opts;
};
-struct vo *init_best_video_out(char **vo_list);
+struct vo *init_best_video_out(struct MPOpts *opts);
int vo_config(struct vo *vo, uint32_t width, uint32_t height,
uint32_t d_width, uint32_t d_height, uint32_t flags,
char *title, uint32_t format);