From bb679dd40a80e72272dec0c8621b888f4365852c Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 24 Apr 2008 08:16:11 +0300 Subject: [PATCH] Remove global vo_flags Move the information to struct sh_video field. --- libmpcodecs/vd.c | 7 +++---- libmpdemux/stheader.h | 1 + libvo/video_out.c | 2 -- libvo/video_out.h | 2 -- mplayer.c | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 1ff8b11522..623be9b2e8 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -104,7 +104,6 @@ vd_functions_t *mpcodecs_vd_drivers[] = { #include "libvo/video_out.h" // libvo opts: -int vo_flags = 0; int vd_use_slices = 1; /** global variables for gamma, brightness, contrast, saturation and hue @@ -178,7 +177,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, continue; } j = i; - vo_flags = flags; + sh->output_flags = flags; if (flags & VFCAP_CSP_SUPPORTED_BY_HW) break; } else if (!palette @@ -242,9 +241,9 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, if (!(sh->codec->outflags[j] & CODECS_FLAG_NOFLIP)) opts->flip = 1; } - if (vo_flags & VFCAP_FLIPPED) + if (sh->output_flags & VFCAP_FLIPPED) opts->flip ^= 1; - if (opts->flip && !(vo_flags & VFCAP_FLIP)) { + if (opts->flip && !(sh->output_flags & VFCAP_FLIP)) { // we need to flip, but no flipping filter avail. vf_add_before_vo(&vf, "flip", NULL); sh->vfilter = vf; diff --git a/libmpdemux/stheader.h b/libmpdemux/stheader.h index e52cc5cb3f..469314b541 100644 --- a/libmpdemux/stheader.h +++ b/libmpdemux/stheader.h @@ -84,6 +84,7 @@ typedef struct sh_video { // output driver/filters: (set by libmpcodecs core) unsigned int outfmtidx; struct vf_instance *vfilter; // the video filter chain, used for this video stream + int output_flags; // query_format() results for output filters+vo struct vd_functions *vd_driver; int vf_initialized; #ifdef DYNAMIC_PLUGINS diff --git a/libvo/video_out.c b/libvo/video_out.c index 9b0ca48504..de060dacf6 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -24,8 +24,6 @@ #include "x11_common.h" #endif -//int vo_flags=0; - int xinerama_screen = -1; int xinerama_x; int xinerama_y; diff --git a/libvo/video_out.h b/libvo/video_out.h index 9b7d93de17..1c13183222 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -239,8 +239,6 @@ void vo_destroy(struct vo *vo); // NULL terminated array of all drivers extern const struct vo_driver *video_out_drivers[]; -extern int vo_flags; - extern int xinerama_screen; extern int xinerama_x; extern int xinerama_y; diff --git a/mplayer.c b/mplayer.c index 5f06ab8fc8..d2bee07ce4 100644 --- a/mplayer.c +++ b/mplayer.c @@ -2123,7 +2123,7 @@ static int sleep_until_update(struct MPContext *mpctx, float *time_frame, //============================== SLEEP: =================================== // flag 256 means: libvo driver does its timing (dvb card) - if (*time_frame > 0.001 && !(vo_flags&256)) + if (*time_frame > 0.001 && !(mpctx->sh_video->output_flags&256)) *time_frame = timing_sleep(*time_frame); return frame_time_remaining; } @@ -3551,7 +3551,7 @@ if(!reinit_video_chain(mpctx)) { } } - if(vo_flags & 0x08 && vo_spudec) + if(mpctx->sh_video->output_flags & 0x08 && vo_spudec) spudec_set_hw_spu(vo_spudec,mpctx->video_out); #ifdef HAVE_FREETYPE