aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/emotion
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-10-15 20:59:57 +0200
committerDave Andreoli <dave@gurumeditation.it>2016-10-16 08:19:30 +0200
commitb8ae4947b6577cc8b5ad173615fac809b13d0800 (patch)
treeeeafcc1f6365f63c4cecdfbb9ba051113f544609 /src/lib/emotion
parentfix edje_cc segv when compiling bling bling theme (diff)
downloadefl-b8ae4947b6577cc8b5ad173615fac809b13d0800.tar.gz
Emotion: prefer ratio to calculate sizes
Instead of calculate the ratio from the sizes, calc the width from the ratio, as ratio seems always accurate. Fallback to the old code if ratio not available (tbh I never see this case) @Fix EMOTION_ASPECT_KEEP_BOTH with some rare strams, mostly DVD and online stuff
Diffstat (limited to 'src/lib/emotion')
-rw-r--r--src/lib/emotion/emotion_smart.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index 16a6677414..52ae0e6d06 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -476,10 +476,20 @@ _efl_canvas_video_aspect_border_apply(Evas_Object *obj, Efl_Canvas_Video_Data *s
int aspect_opt = 0;
- iw = sd->video.w;
- ih = sd->video.h;
+ /* Prefer (if available) the video aspect ratio to calculate the sizes */
+ if (sd->ratio > 0.0)
+ {
+ ir = sd->ratio;
+ ih = sd->video.h;
+ iw = (double)ih * ir;
+ }
+ else
+ {
+ iw = sd->video.w;
+ ih = sd->video.h;
+ ir = (double)iw / ih;
+ }
- ir = (double)iw / ih;
r = (double)w / h;
/* First check if we should fit the width or height of the video inside the