changeset 27447:d35a61df7122

use new lavf API to grab sample_aspect_ratio from the demuxers
author aurel
date Sun, 24 Aug 2008 00:07:09 +0000
parents 9f14e20aaea4
children 5137a84907a1
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Sat Aug 23 08:14:37 2008 +0000
+++ b/libmpdemux/demux_lavf.c	Sun Aug 24 00:07:09 2008 +0000
@@ -343,6 +343,10 @@
             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;