[vlc-devel] commit: libmpeg2: Fix aspect ratio calculation according to MPEG standard. ( Marian Ďurkovič )
git version control
git at videolan.org
Tue Oct 20 18:14:50 CEST 2009
vlc | branch: 1.0-bugfix | Marian Ďurkovič <md at bts.sk> | Tue Oct 20 10:11:24 2009 +0200| [8eb3caef7dd569e0a6f17c628bd28bdcbbbf792d] | committer: Marian Ďurkovič
libmpeg2: Fix aspect ratio calculation according to MPEG standard.
The library delivers us pixel width/height relative to display size
so we must compute it accordingly, otherwise we have conflicting data
in i_sar_num/i_sar_den and i_aspect.
(cherry picked from commit d3cb36d54f49c35a6f507b5aa5db2603e2373ab9)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8eb3caef7dd569e0a6f17c628bd28bdcbbbf792d
---
modules/codec/libmpeg2.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index c55a243..3bf8ef8 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -713,10 +713,10 @@ static void GetAR( decoder_t *p_dec )
if( p_sys->p_info->sequence->pixel_height > 0 )
{
p_sys->i_aspect =
- ((uint64_t)p_sys->p_info->sequence->picture_width) *
+ ((uint64_t)p_sys->p_info->sequence->display_width) *
p_sys->p_info->sequence->pixel_width *
VOUT_ASPECT_FACTOR /
- p_sys->p_info->sequence->picture_height /
+ p_sys->p_info->sequence->display_height /
p_sys->p_info->sequence->pixel_height;
p_sys->i_sar_num = p_sys->p_info->sequence->pixel_width;
p_sys->i_sar_den = p_sys->p_info->sequence->pixel_height;
More information about the vlc-devel
mailing list