changeset 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 debda3544d32
children 773ad7374436
files libmpdemux/demux_y4m.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
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;
     }