From f6f8dc7782a411d1befadcc8425990451047f6cf Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 29 Apr 2014 13:31:59 +0200 Subject: video: remove redundant mp_image display_w/_h members Commit 5e4e248 added a mp_image_params field to mp_image, and moved many parameters to that struct. display_w/h was left redundant with mp_image_params.d_w/d_h. These fields were supposed to be always in sync, but it seems some code forgot to do this correctly, such as vf_fix_img_params() or mp_image_copy_attributes(). This led to the problem in github issue #756, because display_w/_h could become incorrect. It turns out that most code didn't use the old fields anyway. Just remove them. Note that mp_image_params.d_w/d_h are supposed to be always valid, so the additional checks for 0 shouldn't be needed. Remove these checks as well. Fixes #756. --- player/screenshot.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'player/screenshot.c') diff --git a/player/screenshot.c b/player/screenshot.c index 9b8922c39a..1c3177cff7 100644 --- a/player/screenshot.c +++ b/player/screenshot.c @@ -296,11 +296,8 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext) static void add_subs(struct MPContext *mpctx, struct mp_image *image) { - int d_w = image->display_w ? image->display_w : image->w; - int d_h = image->display_h ? image->display_h : image->h; - double sar = (double)image->w / image->h; - double dar = (double)d_w / d_h; + double dar = (double)image->params.d_w / image->params.d_h; struct mp_osd_res res = { .w = image->w, .h = image->h, -- cgit v1.2.3