From 8ec90e5e4faba5754942c3dbc4edfc9f2b939a6a Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 19 Apr 2008 07:04:55 +0300 Subject: [PATCH] Add option pointer to vo struct --- libvo/video_out.c | 8 +++++--- libvo/video_out.h | 3 ++- mplayer.c | 2 +- 3 files changed, 8 insertions(+), 5 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 #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); diff --git a/mplayer.c b/mplayer.c index 488ff3e85b..52a489b1f4 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2143,7 +2143,7 @@ int reinit_video_chain(void) { //shouldn't we set dvideo->id=-2 when we fail? vo_config_count=0; //if((mpctx->video_out->preinit(vo_subdevice))!=0){ - if(!(mpctx->video_out=init_best_video_out(opts->video_driver_list))){ + if(!(mpctx->video_out=init_best_video_out(opts))){ mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorInitializingVODevice); goto err_out; } -- 2.11.4.GIT