diff libmpdemux/demux_y4m.c @ 12529:74968e3440ff

fix bug reported by Leonardo Giordani: sh->aspect is not pixel aspect but movie aspect
author rik
date Thu, 03 Jun 2004 09:52:25 +0000
parents ee7203b48e7c
children cce2717344f4
line wrap: on
line diff
--- a/libmpdemux/demux_y4m.c	Wed Jun 02 23:14:13 2004 +0000
+++ b/libmpdemux/demux_y4m.c	Thu Jun 03 09:52:25 2004 +0000
@@ -195,11 +195,13 @@
 	sh->frametime=1.0f/sh->fps;
 	
 	ratio = y4m_si_get_sampleaspect(priv->si);
-	if (ratio.d != 0 && ratio.n != 0)
-	    sh->aspect = (float)ratio.n/(float)ratio.d;
 
 	sh->disp_w = y4m_si_get_width(priv->si);
 	sh->disp_h = y4m_si_get_height(priv->si);
+
+	if (ratio.d != 0 && ratio.n != 0)
+	    sh->aspect = (float)(sh->disp_w*ratio.n)/(float)(sh->disp_h*ratio.d);
+
     	demuxer->seekable = 0;
     }