diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/aspect.c | 8 | ||||
-rw-r--r-- | video/out/vo.c | 3 | ||||
-rw-r--r-- | video/out/vo_drm.c | 4 | ||||
-rw-r--r-- | video/out/vo_lavc.c | 9 | ||||
-rw-r--r-- | video/out/vo_wayland.c | 4 | ||||
-rw-r--r-- | video/out/vo_x11.c | 4 | ||||
-rw-r--r-- | video/out/win_state.c | 6 |
7 files changed, 15 insertions, 23 deletions
diff --git a/video/out/aspect.c b/video/out/aspect.c index 2e1093c921..2d25bbdfd5 100644 --- a/video/out/aspect.c +++ b/video/out/aspect.c @@ -135,8 +135,8 @@ void mp_get_src_dst_rects(struct mp_log *log, struct mp_vo_opts *opts, { int src_w = video->w; int src_h = video->h; - int src_dw = video->d_w; - int src_dh = video->d_h; + int src_dw, src_dh; + mp_image_params_get_dsize(video, &src_dw, &src_dh); if (video->rotate % 180 == 90 && (vo_caps & VO_CAP_ROTATE90)) { MPSWAP(int, src_w, src_h); MPSWAP(int, src_dw, src_dh); @@ -174,8 +174,8 @@ void mp_get_src_dst_rects(struct mp_log *log, struct mp_vo_opts *opts, mp_verbose(log, "Window size: %dx%d\n", window_w, window_h); - mp_verbose(log, "Video source: %dx%d (%dx%d)\n", - video->w, video->h, video->d_w, video->d_h); + mp_verbose(log, "Video source: %dx%d (%d:%d)\n", + video->w, video->h, video->p_w, video->p_h); mp_verbose(log, "Video display: (%d, %d) %dx%d -> (%d, %d) %dx%d\n", src.x0, src.y0, sw, sh, dst.x0, dst.y0, dw, dh); mp_verbose(log, "Video scale: %f/%f\n", diff --git a/video/out/vo.c b/video/out/vo.c index 6318ac7dc5..f65ff864e5 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -508,8 +508,7 @@ static void run_reconfig(void *p) struct vo_internal *in = vo->in; - vo->dwidth = params->d_w; - vo->dheight = params->d_h; + mp_image_params_get_dsize(params, &vo->dwidth, &vo->dheight); talloc_free(vo->params); vo->params = talloc_memdup(vo, params, sizeof(*params)); diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c index f671acf989..740631ddb4 100644 --- a/video/out/vo_drm.c +++ b/video/out/vo_drm.c @@ -305,8 +305,8 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) .imgfmt = IMGFMT, .w = w, .h = h, - .d_w = w, - .d_h = h, + .p_w = 1, + .p_h = 1, }; talloc_free(p->cur_frame); diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c index 09e8af748c..aae7f7b934 100644 --- a/video/out/vo_lavc.c +++ b/video/out/vo_lavc.c @@ -93,8 +93,7 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) { struct priv *vc = vo->priv; enum AVPixelFormat pix_fmt = imgfmt2pixfmt(params->imgfmt); - AVRational display_aspect_ratio, image_aspect_ratio; - AVRational aspect; + AVRational aspect = {params->p_w, params->p_h}; uint32_t width = params->w; uint32_t height = params->h; @@ -103,12 +102,6 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) pthread_mutex_lock(&vo->encode_lavc_ctx->lock); - display_aspect_ratio.num = params->d_w; - display_aspect_ratio.den = params->d_h; - image_aspect_ratio.num = width; - image_aspect_ratio.den = height; - aspect = av_div_q(display_aspect_ratio, image_aspect_ratio); - if (vc->stream) { /* NOTE: * in debug builds we get a "comparison between signed and unsigned" diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index dcbe2d5347..2fb60d96d1 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -299,8 +299,8 @@ static bool resize(struct priv *p) .imgfmt = p->video_format->mp_format, .w = p->dst_w, .h = p->dst_h, - .d_w = p->dst_w, - .d_h = p->dst_h, + .p_w = 1, + .p_h = 1, }; mp_image_params_guess_csp(&p->sws->dst); diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index 7f4e36fbb6..d763592020 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -259,8 +259,8 @@ static bool resize(struct vo *vo) .imgfmt = fmte->mpfmt, .w = p->dst_w, .h = p->dst_h, - .d_w = p->dst_w, - .d_h = p->dst_h, + .p_w = 1, + .p_h = 1, }; mp_image_params_guess_csp(&p->sws->dst); diff --git a/video/out/win_state.c b/video/out/win_state.c index f48f628173..a80a650315 100644 --- a/video/out/win_state.c +++ b/video/out/win_state.c @@ -82,12 +82,12 @@ void vo_calc_window_geometry(struct vo *vo, const struct mp_rect *screen, // The case of calling this function even though no video was configured // yet (i.e. vo->params==NULL) happens when vo_opengl creates a hidden // window in order to create an OpenGL context. - struct mp_image_params params = { .d_w = 320, .d_h = 200 }; + struct mp_image_params params = { .w = 320, .h = 200 }; if (vo->params) params = *vo->params; - int d_w = params.d_w; - int d_h = params.d_h; + int d_w, d_h; + mp_image_params_get_dsize(¶ms, &d_w, &d_h); if ((vo->driver->caps & VO_CAP_ROTATE90) && params.rotate % 180 == 90) MPSWAP(int, d_w, d_h); d_w = MPCLAMP(d_w * opts->window_scale, 1, 16000); |