billiob pushed a commit to branch master.
commit 3d804bf38d70225de3034451c98ed13eee027206
Author: Boris Faure <[email protected]>
Date: Mon May 20 16:12:39 2013 +0200
tycat: fix videos aspect ratio when emotion_object_video_handled_get() fails
Sometimes, emotion_object_video_handled_get() will return NULL. In that
case, the video will be stretched to the terminal's width but only 3 lines
high. Use A/R information for better scaling.
Also support videos and fix aspect ratio.
Patch by jpeg.
---
src/bin/tycat.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/bin/tycat.c b/src/bin/tycat.c
index a1b7900..b620e4d 100644
--- a/src/bin/tycat.c
+++ b/src/bin/tycat.c
@@ -287,9 +287,21 @@ main(int argc, char **argv)
scaleterm(w, h, &iw, &ih);
prnt(rp, iw, ih, mode);
}
+ else ok = EINA_FALSE;
+ }
+ else ok = EINA_FALSE;
+
+ if (!ok)
+ {
+ double ar = emotion_object_ratio_get(o);
+ if (ar > 0.0)
+ {
+ scaleterm(tw * cw, (int) ((tw * cw)
/ ar), &iw, &ih);
+ prnt(rp, iw, ih, mode);
+ }
+ else
+ prnt(rp, tw, 3, NOIMG);
}
- else
- prnt(rp, tw, 3, NOIMG);
goto done;
}
}
--
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d