[MPlayer-dev-eng] [PATCH] vf_expand cripples aspect upon reconfiguring
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 29 10:56:56 CET 2006
Hello,
On Wed, Oct 04, 2006 at 01:33:10PM +0200, Tomas Janousek wrote:
> The expand filter cripples the aspect ratio, when it's set as an expand
> parameter and the config function is called without reopening the filter
> stack. This happens for example when clicking a button in DVD menu or
> (untested but I think it does) when the aspect ratio of a dvb stream
> changes.
Please test this, it seems simpler to me, and there is no need to store
the adjusted aspect, it seems to be used nowhere else.
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpcodecs/vf_expand.c
===================================================================
--- libmpcodecs/vf_expand.c (revision 20499)
+++ libmpcodecs/vf_expand.c (working copy)
@@ -184,11 +184,12 @@
else if( vf->priv->exp_h<height ) vf->priv->exp_h=height;
#endif
if (vf->priv->aspect) {
- vf->priv->aspect *= ((double)width/height) / ((double)d_width/d_height);
- if (vf->priv->exp_h < vf->priv->exp_w / vf->priv->aspect) {
- vf->priv->exp_h = vf->priv->exp_w / vf->priv->aspect + 0.5;
+ float curaspect = vf->priv->aspect;
+ curaspect *= ((double)width/height) / ((double)d_width/d_height);
+ if (vf->priv->exp_h < vf->priv->exp_w / aspect) {
+ vf->priv->exp_h = vf->priv->exp_w / aspect + 0.5;
} else {
- vf->priv->exp_w = vf->priv->exp_h * vf->priv->aspect + 0.5;
+ vf->priv->exp_w = vf->priv->exp_h * aspect + 0.5;
}
}
if (vf->priv->round > 1) { // round up.
More information about the MPlayer-dev-eng
mailing list