]> git.sesse.net Git - vlc/commitdiff
* modules/codec/libmpeg2.c: modified last change to use a 4:3 aspect ratio when libmp...
authorGildas Bazin <gbazin@videolan.org>
Mon, 22 Mar 2004 15:19:12 +0000 (15:19 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 22 Mar 2004 15:19:12 +0000 (15:19 +0000)
  (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

index 14a5cfd93a0d548a9b9ab8d86a913b479e964889..88c2a642c2f50baebb240d05a738a58438abe6a1 100755 (executable)
@@ -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;
                 }
             }