[MPlayer-cvslog] r27479 - trunk/libmpdemux/demux_lavf.c

aurel subversion at mplayerhq.hu
Sun Aug 24 02:07:09 CEST 2008


Author: aurel
Date: Sun Aug 24 02:07:09 2008
New Revision: 27479

Log:
use new lavf API to grab sample_aspect_ratio from the demuxers


Modified:
   trunk/libmpdemux/demux_lavf.c

Modified: trunk/libmpdemux/demux_lavf.c
==============================================================================
--- trunk/libmpdemux/demux_lavf.c	(original)
+++ trunk/libmpdemux/demux_lavf.c	Sun Aug 24 02:07:09 2008
@@ -343,6 +343,10 @@ static void handle_stream(demuxer_t *dem
             sh_video->fps=av_q2d(st->r_frame_rate);
             sh_video->frametime=1/av_q2d(st->r_frame_rate);
             sh_video->format=bih->biCompression;
+            if(st->sample_aspect_ratio.num)
+                sh_video->aspect = codec->width  * st->sample_aspect_ratio.num
+                         / (float)(codec->height * st->sample_aspect_ratio.den);
+            else
             sh_video->aspect=codec->width * codec->sample_aspect_ratio.num
                                / (float)(codec->height * codec->sample_aspect_ratio.den);
             sh_video->i_bps=codec->bit_rate/8;



More information about the MPlayer-cvslog mailing list