]> git.sesse.net Git - vlc/commitdiff
Fixed seeking in mpeg1 files with libmpeg2 decoder (close #2953).
authorLaurent Aimar <fenrir@videolan.org>
Sat, 11 Jul 2009 16:55:43 +0000 (18:55 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 11 Jul 2009 17:12:05 +0000 (19:12 +0200)
mpeg1 files may have only one sequence header.

It can be backported to 1.0 only after being carefully tested.

modules/codec/libmpeg2.c

index 7d24de48940e7628d72472e12800e5a89b4b92a6..2c41e358d259f3094154781bc5d58931c0c8c9a7 100644 (file)
@@ -395,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;
+                    }
                 }
             }
 
@@ -614,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 );
 }