Correctly reset date after a discontinuity in audio decoder.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 29 Nov 2008 20:15:27 +0000 (21:15 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 30 Nov 2008 15:51:44 +0000 (16:51 +0100)
modules/codec/a52.c
modules/codec/avcodec/audio.c
modules/codec/dts.c
modules/codec/flac.c
modules/codec/mpeg_audio.c
modules/packetizer/mlp.c
modules/packetizer/mpeg4audio.c

index 82112f9..797f8d0 100644 (file)
@@ -191,7 +191,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             p_sys->i_state = STATE_NOSYNC;
             block_BytestreamFlush( &p_sys->bytestream );
         }
-//        aout_DateSet( &p_sys->end_date, 0 );
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         return NULL;
     }
index ba13919..e8a2a41 100644 (file)
@@ -261,6 +261,8 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
     {
         block_Release( p_block );
         avcodec_flush_buffers( p_sys->p_context );
+        p_sys->i_samples = 0;
+        aout_DateSet( &p_sys->end_date, 0 );
 
         if( p_sys->i_codec_id == CODEC_ID_MP2 || p_sys->i_codec_id == CODEC_ID_MP3 )
             p_sys->i_reject_count = 3;
index 1dd9379..2486edc 100644 (file)
@@ -179,7 +179,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             p_sys->i_state = STATE_NOSYNC;
             block_BytestreamFlush( &p_sys->bytestream );
         }
-//        aout_DateSet( &p_sys->end_date, 0 );
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         return NULL;
     }
index c9d8069..6ebd53c 100644 (file)
@@ -388,7 +388,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
             p_sys->i_state = STATE_NOSYNC;
             block_BytestreamFlush( &p_sys->bytestream );
         }
-//        aout_DateSet( &p_sys->end_date, 0 );
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         return NULL;
     }
index 96fe2aa..bb2493f 100644 (file)
@@ -208,7 +208,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             p_sys->i_state = STATE_NOSYNC;
             block_BytestreamFlush( &p_sys->bytestream );
         }
-//        aout_DateSet( &p_sys->end_date, 0 );
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         p_sys->b_discontinuity = true;
         return NULL;
index 2a30849..92eb8a4 100644 (file)
@@ -166,6 +166,7 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
             p_sys->i_state = STATE_NOSYNC;
             block_BytestreamFlush( &p_sys->bytestream );
         }
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         return NULL;
     }
index 7842480..2bf711b 100644 (file)
@@ -290,7 +290,7 @@ static block_t *PacketizeRawBlock( decoder_t *p_dec, block_t **pp_block )
 
     if( (*pp_block)->i_flags&(BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
     {
-        //aout_DateSet( &p_sys->end_date, 0 );
+        aout_DateSet( &p_sys->end_date, 0 );
         block_Release( *pp_block );
         return NULL;
     }