Move movie_aspect to options struct

This commit is contained in:
Uoti Urpala 2008-04-24 07:36:43 +03:00
parent 0a39709c15
commit 60e2c8604d
11 changed files with 8 additions and 13 deletions

View File

@ -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),

View File

@ -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;

View 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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -29,7 +29,6 @@
extern float monitor_aspect;
extern float movie_aspect;
int dxr2_fd = -1;

View File

@ -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;

View File

@ -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;

View File

@ -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 {