]> git.sesse.net Git - vlc/blobdiff - modules/codec/libmpeg2.c
configure: don't enable goom on OS X by default
[vlc] / modules / codec / libmpeg2.c
index 7a903224a246129ae9cb17dadc2dd54b56247ba0..2c41e358d259f3094154781bc5d58931c0c8c9a7 100644 (file)
@@ -285,9 +285,12 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             if( p_sys->p_synchro )
                 decoder_SynchroRelease( p_sys->p_synchro );
 
-            p_sys->p_synchro =
-                decoder_SynchroInit( p_dec, (uint32_t)((uint64_t)1001000000 * 27 /
-                                     p_sys->p_info->sequence->frame_period) );
+            if( p_sys->p_info->sequence->frame_period <= 0 )
+                p_sys->p_synchro = NULL;
+            else
+                p_sys->p_synchro =
+                decoder_SynchroInit( p_dec, (uint32_t)(UINT64_C(1001000000) *
+                                27 / p_sys->p_info->sequence->frame_period) );
             p_sys->b_after_sequence_header = true;
             break;
         }
@@ -392,8 +395,14 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
                 if( !p_pic )
                 {
                     Reset( p_dec );
-                    block_Release( p_block );
-                    return NULL;
+
+                    p_pic = DpbNewPicture( p_dec );
+                    if( !p_pic )
+                    {
+                        mpeg2_reset( p_sys->p_mpeg2dec, 1 );
+                        block_Release( p_block );
+                        return NULL;
+                    }
                 }
             }
 
@@ -611,7 +620,7 @@ static void Reset( decoder_t *p_dec )
     decoder_sys_t *p_sys = p_dec->p_sys;
 
     cc_Flush( &p_sys->cc );
-    mpeg2_reset( p_sys->p_mpeg2dec, p_sys->p_info->sequence != NULL );
+    mpeg2_reset( p_sys->p_mpeg2dec, 0 );
     DpbClean( p_dec );
 }
 
@@ -726,16 +735,20 @@ static void GetAR( decoder_t *p_dec )
         }
     }
 
-    msg_Dbg( p_dec, "%dx%d (display %d,%d), aspect %d, sar %i:%i, %u.%03u fps",
-             p_sys->p_info->sequence->picture_width,
-             p_sys->p_info->sequence->picture_height,
-             p_sys->p_info->sequence->display_width,
-             p_sys->p_info->sequence->display_height,
-             p_sys->i_aspect, p_sys->i_sar_num, p_sys->i_sar_den,
-             (uint32_t)((uint64_t)1001000000 * 27 /
-                 p_sys->p_info->sequence->frame_period / 1001),
-             (uint32_t)((uint64_t)1001000000 * 27 /
-                 p_sys->p_info->sequence->frame_period % 1001) );
+    if( p_sys->p_info->sequence->frame_period > 0 )
+        msg_Dbg( p_dec,
+                 "%dx%d (display %d,%d), aspect %d, sar %i:%i, %u.%03u fps",
+                 p_sys->p_info->sequence->picture_width,
+                 p_sys->p_info->sequence->picture_height,
+                 p_sys->p_info->sequence->display_width,
+                 p_sys->p_info->sequence->display_height,
+                 p_sys->i_aspect, p_sys->i_sar_num, p_sys->i_sar_den,
+                 (uint32_t)((uint64_t)1001000000 * 27 /
+                     p_sys->p_info->sequence->frame_period / 1001),
+                 (uint32_t)((uint64_t)1001000000 * 27 /
+                     p_sys->p_info->sequence->frame_period % 1001) );
+    else
+        msg_Dbg( p_dec, "bad frame period" );
 }
 
 /*****************************************************************************