Commit 47af7949 authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/libmpeg2.c: modified last change to use a 4:3 aspect ratio...

* 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).
parent 7db4c54c
...@@ -298,16 +298,17 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -298,16 +298,17 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{ {
p_sys->i_aspect = p_sys->i_aspect =
((uint64_t)p_sys->p_info->sequence->display_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->pixel_width *
VOUT_ASPECT_FACTOR /
p_sys->p_info->sequence->display_height / p_sys->p_info->sequence->display_height /
p_sys->p_info->sequence->pixel_height; p_sys->p_info->sequence->pixel_height;
} }
else else
{ {
/* Handle invalid aspect as square */ /* Invalid aspect, assume 4:3.
p_sys->i_aspect = VOUT_ASPECT_FACTOR * * This shouldn't happen and if it does it is a bug
p_sys->p_info->sequence->width / * in libmpeg2 (likely triggered by an invalid stream) */
p_sys->p_info->sequence->height; p_sys->i_aspect = VOUT_ASPECT_FACTOR * 4 / 3;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment