[vlc-devel] commit: Fixed various decoder/packetizer flush. (Laurent Aimar )

git version control git at videolan.org
Mon Feb 9 21:09:09 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Feb  8 16:51:58 2009 +0100| [3801da9dcde2f56498d49709250abc59502eea59] | committer: Laurent Aimar 

Fixed various decoder/packetizer flush.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3801da9dcde2f56498d49709250abc59502eea59
---

 modules/codec/a52.c             |    2 +-
 modules/codec/dts.c             |    2 +-
 modules/codec/flac.c            |    2 +-
 modules/codec/mpeg_audio.c      |    2 +-
 modules/packetizer/h264.c       |    5 ++++-
 modules/packetizer/mlp.c        |    2 +-
 modules/packetizer/mpeg4audio.c |    4 ++--
 modules/packetizer/mpeg4video.c |   16 ++++++++--------
 modules/packetizer/mpegvideo.c  |    8 +++++---
 modules/packetizer/vc1.c        |    4 ++--
 10 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/modules/codec/a52.c b/modules/codec/a52.c
index 797f8d0..df56752 100644
--- a/modules/codec/a52.c
+++ b/modules/codec/a52.c
@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
         }
         aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
diff --git a/modules/codec/dts.c b/modules/codec/dts.c
index ac486ef..62a771d 100644
--- a/modules/codec/dts.c
+++ b/modules/codec/dts.c
@@ -189,7 +189,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
         }
         aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index d7130dc..6206360 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -386,7 +386,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
         }
         aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
diff --git a/modules/codec/mpeg_audio.c b/modules/codec/mpeg_audio.c
index 34d43a2..306bf07 100644
--- a/modules/codec/mpeg_audio.c
+++ b/modules/codec/mpeg_audio.c
@@ -208,7 +208,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
         }
         aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index 03120b6..b8ffeaf 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -421,7 +421,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
 
             if( p_sys->p_frame )
                 block_ChainRelease( p_sys->p_frame );
@@ -429,6 +429,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             p_sys->slice.i_frame_type = 0;
             p_sys->b_slice = false;
         }
+        p_sys->i_frame_pts = -1;
+        p_sys->i_frame_dts = -1;
+
         block_Release( *pp_block );
         return NULL;
     }
diff --git a/modules/packetizer/mlp.c b/modules/packetizer/mlp.c
index cd4ce12..5722c0c 100644
--- a/modules/packetizer/mlp.c
+++ b/modules/packetizer/mlp.c
@@ -165,7 +165,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         {
             p_sys->b_mlp = false;
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
         }
         aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c
index 2bf711b..e087980 100644
--- a/modules/packetizer/mpeg4audio.c
+++ b/modules/packetizer/mpeg4audio.c
@@ -972,9 +972,9 @@ static block_t *PacketizeStreamBlock( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
         }
-        //aout_DateSet( &p_sys->end_date, 0 );
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         return NULL;
     }
diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
index 7f953c3..06e5f4e 100644
--- a/modules/packetizer/mpeg4video.c
+++ b/modules/packetizer/mpeg4video.c
@@ -229,20 +229,20 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
 
             if( p_sys->p_frame )
                 block_ChainRelease( p_sys->p_frame );
             p_sys->p_frame = NULL;
             p_sys->pp_last = &p_sys->p_frame;
         }
-//        p_sys->i_interpolated_pts =
-//        p_sys->i_interpolated_dts =
-//        p_sys->i_last_ref_pts =
-//        p_sys->i_last_time_ref =
-//        p_sys->i_time_ref =
-//        p_sys->i_last_time =
-//        p_sys->i_last_timeincr = 0;
+        p_sys->i_interpolated_pts =
+        p_sys->i_interpolated_dts =
+        p_sys->i_last_ref_pts =
+        p_sys->i_last_time_ref =
+        p_sys->i_time_ref =
+        p_sys->i_last_time =
+        p_sys->i_last_timeincr = 0;
 
         block_Release( *pp_block );
         return NULL;
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 23c2eef..e841928 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -263,7 +263,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
 
             p_sys->b_discontinuity = true;
             if( p_sys->p_frame )
@@ -272,8 +272,10 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             p_sys->pp_last = &p_sys->p_frame;
             p_sys->b_frame_slice = false;
         }
-//        p_sys->i_interpolated_dts =
-//        p_sys->i_last_ref_pts = 0;
+        p_sys->i_dts = 0;
+        p_sys->i_pts = 0;
+        p_sys->i_interpolated_dts = 0;
+        p_sys->i_last_ref_pts = 0;
 
         block_Release( *pp_block );
         return NULL;
diff --git a/modules/packetizer/vc1.c b/modules/packetizer/vc1.c
index cfbda1c..8a4b506 100644
--- a/modules/packetizer/vc1.c
+++ b/modules/packetizer/vc1.c
@@ -203,7 +203,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         if( (*pp_block)->i_flags&BLOCK_FLAG_CORRUPTED )
         {
             p_sys->i_state = STATE_NOSYNC;
-            block_BytestreamFlush( &p_sys->bytestream );
+            block_BytestreamEmpty( &p_sys->bytestream );
 
             if( p_sys->p_frame )
                 block_ChainRelease( p_sys->p_frame );
@@ -211,7 +211,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             p_sys->pp_last = &p_sys->p_frame;
             p_sys->b_frame = false;
         }
-//        p_sys->i_interpolated_dts = 0;
+        p_sys->i_interpolated_dts = 0;
         block_Release( *pp_block );
         return NULL;
     }




More information about the vlc-devel mailing list