From 0dbad9503fd4fd2d9bc3ed443ad761eaf020fdef Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 14 Feb 2018 23:40:09 +0100 Subject: vo_gpu: hwdec_drmprime_drm: cosmetic simplification Coverity complained about the redundant init of hratio etc. - just remove that and merge declaration/init of these variables. Also the first double cast in each expression is unnecessary. --- video/out/opengl/hwdec_drmprime_drm.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c index e420bf4f33..69e9d1eb00 100644 --- a/video/out/opengl/hwdec_drmprime_drm.c +++ b/video/out/opengl/hwdec_drmprime_drm.c @@ -91,15 +91,12 @@ static void set_current_frame(struct ra_hwdec *hw, struct drm_frame *frame) static void scale_dst_rect(struct ra_hwdec *hw, int source_w, int source_h ,struct mp_rect *src, struct mp_rect *dst) { struct priv *p = hw->priv; - double hratio, vratio, ratio; // drm can allow to have a layer that has a different size from framebuffer // we scale here the destination size to video mode - hratio = vratio = ratio = 1.0; - - hratio = (double)p->display_w / (double)source_w; - vratio = (double)p->display_h / (double)source_h; - ratio = hratio <= vratio ? hratio : vratio; + double hratio = p->display_w / (double)source_w; + double vratio = p->display_h / (double)source_h; + double ratio = hratio <= vratio ? hratio : vratio; dst->x0 = src->x0 * ratio; dst->x1 = src->x1 * ratio; -- cgit v1.2.3