mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
Move screen_size_xy to options struct
This commit is contained in:
parent
b14909a955
commit
0a39709c15
@ -229,7 +229,7 @@
|
||||
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},
|
||||
{"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0.001, 4096, NULL},
|
||||
OPT_FLOATRANGE("xy", screen_size_xy, 0, 0.001, 4096),
|
||||
|
||||
OPT_FLAG_CONSTANTS("flip", flip, 0, -1, 1),
|
||||
OPT_FLAG_CONSTANTS("noflip", flip, 0, -1, 0),
|
||||
|
@ -8,7 +8,6 @@ extern int mp_msg_color;
|
||||
extern int mp_msg_module;
|
||||
|
||||
// codec/filter opts: (defined at libmpcodecs/vd.c)
|
||||
extern float screen_size_xy;
|
||||
extern float movie_aspect;
|
||||
|
||||
/* defined in codec-cfg.c */
|
||||
|
@ -111,7 +111,6 @@ vd_functions_t* mpcodecs_vd_drivers[] = {
|
||||
#include "libvo/video_out.h"
|
||||
|
||||
// libvo opts:
|
||||
float screen_size_xy=0;
|
||||
float movie_aspect=-1.0;
|
||||
int vo_flags=0;
|
||||
int vd_use_slices=1;
|
||||
@ -260,15 +259,15 @@ csp_again:
|
||||
// check source format aspect, calculate prescale ::atmos
|
||||
screen_size_x=sh->disp_w;
|
||||
screen_size_y=sh->disp_h;
|
||||
if(screen_size_xy>=0.001){
|
||||
if(screen_size_xy<=8){
|
||||
if(opts->screen_size_xy>=0.001){
|
||||
if(opts->screen_size_xy<=8){
|
||||
// -xy means x+y scale
|
||||
screen_size_x*=screen_size_xy;
|
||||
screen_size_y*=screen_size_xy;
|
||||
screen_size_x*=opts->screen_size_xy;
|
||||
screen_size_y*=opts->screen_size_xy;
|
||||
} else {
|
||||
// -xy means forced width while keeping correct aspect
|
||||
screen_size_x=screen_size_xy;
|
||||
screen_size_y=screen_size_xy*sh->disp_h/sh->disp_w;
|
||||
screen_size_x=opts->screen_size_xy;
|
||||
screen_size_y=opts->screen_size_xy*sh->disp_h/sh->disp_w;
|
||||
}
|
||||
}
|
||||
if(sh->aspect>0.01){
|
||||
@ -277,7 +276,7 @@ csp_again:
|
||||
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ASPECT=%1.4f\n", sh->aspect);
|
||||
w=(int)((float)screen_size_y*sh->aspect); w+=w%2; // round
|
||||
// we don't like horizontal downscale || user forced width:
|
||||
if(w<screen_size_x || screen_size_xy>8){
|
||||
if(w<screen_size_x || opts->screen_size_xy>8){
|
||||
screen_size_y=(int)((float)screen_size_x*(1.0/sh->aspect));
|
||||
screen_size_y+=screen_size_y%2; // round
|
||||
} else screen_size_x=w; // keep new width
|
||||
|
@ -42,8 +42,6 @@ static struct vf_priv_s {
|
||||
NULL
|
||||
};
|
||||
|
||||
extern float screen_size_xy;
|
||||
|
||||
//===========================================================================//
|
||||
|
||||
void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam);
|
||||
@ -297,7 +295,7 @@ static int config(struct vf_instance* vf,
|
||||
}
|
||||
|
||||
if (!opts->screen_size_x && !opts->screen_size_y
|
||||
&& !(screen_size_xy >= 0.001)) {
|
||||
&& !(opts->screen_size_xy >= 0.001)) {
|
||||
// Compute new d_width and d_height, preserving aspect
|
||||
// while ensuring that both are >= output size in pixels.
|
||||
if (vf->priv->h * d_width > vf->priv->w * d_height) {
|
||||
|
Loading…
Reference in New Issue
Block a user