From 47af7949f1b5d1d28426b65abcc31816c8930496 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Mon, 22 Mar 2004 15:19:12 +0000 Subject: [PATCH] * modules/codec/libmpeg2.c: modified last change to use a 4:3 aspect ratio when libmpeg2 gives us an invalid one. (if this happens, it is a bug in libmpeg2 anyway so we just try to fallback to the most usual value). --- modules/codec/libmpeg2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c index 14a5cfd93a..88c2a642c2 100755 --- a/modules/codec/libmpeg2.c +++ b/modules/codec/libmpeg2.c @@ -298,16 +298,17 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) { p_sys->i_aspect = ((uint64_t)p_sys->p_info->sequence->display_width) * - p_sys->p_info->sequence->pixel_width * VOUT_ASPECT_FACTOR / + p_sys->p_info->sequence->pixel_width * + VOUT_ASPECT_FACTOR / p_sys->p_info->sequence->display_height / p_sys->p_info->sequence->pixel_height; } else { - /* Handle invalid aspect as square */ - p_sys->i_aspect = VOUT_ASPECT_FACTOR * - p_sys->p_info->sequence->width / - p_sys->p_info->sequence->height; + /* Invalid aspect, assume 4:3. + * This shouldn't happen and if it does it is a bug + * in libmpeg2 (likely triggered by an invalid stream) */ + p_sys->i_aspect = VOUT_ASPECT_FACTOR * 4 / 3; } } -- 2.39.2