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.
This commit is contained in:
Boris Faure 2013-05-20 16:12:39 +02:00
parent 4f6aed0488
commit 3d804bf38d
1 changed files with 14 additions and 2 deletions

View File

@ -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;
}
}