diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-24 07:36:43 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-25 03:34:28 +0300 |
commit | 60e2c8604d29963e8b4a4dc5f506a3886c58202d (patch) | |
tree | 816b4ecc2226d62d3bad9d084458026dbd1cf280 | |
parent | 0a39709c15890161388e6d32cceea2ff3350aa82 (diff) |
Move movie_aspect to options struct
-rw-r--r-- | cfg-common-opts.h | 4 | ||||
-rw-r--r-- | cfg-common.h | 3 | ||||
-rw-r--r-- | command.c | 4 | ||||
-rw-r--r-- | defaultopts.c | 1 | ||||
-rw-r--r-- | libmpcodecs/vd.c | 3 | ||||
-rw-r--r-- | libvo/aspect.c | 1 | ||||
-rw-r--r-- | libvo/old_vo_defines.h | 1 | ||||
-rw-r--r-- | libvo/vo_dxr2.c | 1 | ||||
-rw-r--r-- | libvo/vo_quartz.c | 1 | ||||
-rw-r--r-- | mplayer.h | 1 | ||||
-rw-r--r-- | options.h | 1 |
11 files changed, 8 insertions, 13 deletions
diff --git a/cfg-common-opts.h b/cfg-common-opts.h index 0bb61499d8..e4dd1edc12 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -227,8 +227,8 @@ {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, OPT_FLAG_ON("zoom", softzoom, 0), OPT_FLAG_OFF("nozoom", softzoom, 0), - {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL}, - {"noaspect", &movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + OPT_FLOATRANGE("aspect", movie_aspect, 0, 0.2, 3.0), + OPT_FLAG_CONSTANTS("noaspect", movie_aspect, 0, 0, 0), OPT_FLOATRANGE("xy", screen_size_xy, 0, 0.001, 4096), OPT_FLAG_CONSTANTS("flip", flip, 0, -1, 1), diff --git a/cfg-common.h b/cfg-common.h index bc4fdaa0f6..0e5bc60abc 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -7,9 +7,6 @@ extern char *mp_msg_charset; extern int mp_msg_color; extern int mp_msg_module; -// codec/filter opts: (defined at libmpcodecs/vd.c) -extern float movie_aspect; - /* defined in codec-cfg.c */ extern char * codecs_file; @@ -2413,9 +2413,9 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) case MP_CMD_SWITCH_RATIO: if (cmd->nargs == 0 || cmd->args[0].v.f == -1) - movie_aspect = (float) sh_video->disp_w / sh_video->disp_h; + opts->movie_aspect = (float) sh_video->disp_w / sh_video->disp_h; else - movie_aspect = cmd->args[0].v.f; + opts->movie_aspect = cmd->args[0].v.f; mpcodecs_config_vo(sh_video, sh_video->disp_w, sh_video->disp_h, 0); break; diff --git a/defaultopts.c b/defaultopts.c index 57425ac746..ace5395010 100644 --- a/defaultopts.c +++ b/defaultopts.c @@ -14,6 +14,7 @@ void set_default_mplayer_options(struct MPOpts *opts) .video_id = -1, .sub_id = -2, .playback_speed = 1., + .movie_aspect = -1., .flip = -1, .lavc_param = (struct lavc_param){ .workaround_bugs = 1, // autodetect diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 3f25e7642e..49f164648c 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -111,7 +111,6 @@ vd_functions_t* mpcodecs_vd_drivers[] = { #include "libvo/video_out.h" // libvo opts: -float movie_aspect=-1.0; int vo_flags=0; int vd_use_slices=1; @@ -242,7 +241,7 @@ csp_again: // time to do aspect ratio corrections... - if(movie_aspect>-1.0) sh->aspect = movie_aspect; // cmdline overrides autodetect + if(opts->movie_aspect>-1.0) sh->aspect = opts->movie_aspect; // cmdline overrides autodetect else if(sh->stream_aspect!=0.0) sh->aspect = sh->stream_aspect; // if(!sh->aspect) sh->aspect=1.0; diff --git a/libvo/aspect.c b/libvo/aspect.c index dfed30d976..e9d414ac87 100644 --- a/libvo/aspect.c +++ b/libvo/aspect.c @@ -22,7 +22,6 @@ float vo_panscanrange = 1.0; float force_monitor_aspect=0; float monitor_aspect=0; float monitor_pixel_aspect=1; -extern float movie_aspect; static struct { int orgw; // real width diff --git a/libvo/old_vo_defines.h b/libvo/old_vo_defines.h index db3084373e..fd266c1896 100644 --- a/libvo/old_vo_defines.h +++ b/libvo/old_vo_defines.h @@ -18,4 +18,5 @@ #define vo_screenwidth global_vo->opts->vo_screenwidth #define vo_screenheight global_vo->opts->vo_screenheight #define vidmode global_vo->opts->vidmode +#define movie_aspect global_vo->opts->movie_aspect #endif diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index 75e0ca1a81..f4fd5e9f63 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -29,7 +29,6 @@ extern float monitor_aspect; -extern float movie_aspect; int dxr2_fd = -1; diff --git a/libvo/vo_quartz.c b/libvo/vo_quartz.c index ddaedd8b99..be869b78c3 100644 --- a/libvo/vo_quartz.c +++ b/libvo/vo_quartz.c @@ -71,7 +71,6 @@ static int get_image_done = 0; static int vo_quartz_fs; // we are in fullscreen extern float monitor_aspect; -extern float movie_aspect; static float old_movie_aspect; static int winLevel = 1; @@ -23,7 +23,6 @@ extern unsigned int osd_visible; extern char * font_name; extern char * sub_font_name; extern float font_factor; -extern float movie_aspect; extern double force_fps; //extern char **sub_name; @@ -21,6 +21,7 @@ typedef struct MPOpts { int sub_id; float playback_speed; int softzoom; + float movie_aspect; float screen_size_xy; int flip; struct lavc_param { |