[MPlayer-dev-eng] [PATCH] vf_expand cripples aspect upon reconfiguring

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 29 11:09:05 CET 2006


Hello,
On Sun, Oct 29, 2006 at 10:56:56AM +0100, Reimar D?ffinger wrote:
> 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.

Should have tested at least compilation. Fixed patch.

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 adjusted_aspect = vf->priv->aspect;
+        adjusted_aspect *= ((double)width/height) / ((double)d_width/d_height);
+        if (vf->priv->exp_h < vf->priv->exp_w / adjusted_aspect) {
+            vf->priv->exp_h = vf->priv->exp_w / adjusted_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 * adjusted_aspect + 0.5;
         }
     }
     if (vf->priv->round > 1) { // round up.


More information about the MPlayer-dev-eng mailing list