aes3: fix invalid timestamps
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 2 May 2018 16:11:56 +0000 (19:11 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 2 May 2018 16:11:56 +0000 (19:11 +0300)
modules/codec/aes3.c

index a7e2cbd..6acff65 100644 (file)
@@ -231,7 +231,7 @@ static void Flush( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    date_Set( &p_sys->end_date, 0 );
+    date_Set( &p_sys->end_date, VLC_TS_INVALID );
 }
 
 /*****************************************************************************
@@ -279,7 +279,7 @@ static int Open( decoder_t *p_dec, bool b_packetizer )
 
     /* Misc init */
     date_Init( &p_sys->end_date, 48000, 1 );
-    date_Set( &p_sys->end_date, 0 );
+    date_Set( &p_sys->end_date, VLC_TS_INVALID );
 
     /* Set output properties */
     p_dec->fmt_out.audio.i_rate = 48000;
@@ -340,13 +340,13 @@ static block_t * Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits,
     }
 
     /* Date management */
-    if( p_block->i_pts > VLC_TS_INVALID &&
+    if( p_block->i_pts != VLC_TS_INVALID &&
         p_block->i_pts != date_Get( &p_sys->end_date ) )
     {
         date_Set( &p_sys->end_date, p_block->i_pts );
     }
 
-    if( !date_Get( &p_sys->end_date ) )
+    if( date_Get( &p_sys->end_date ) == VLC_TS_INVALID )
     {
         /* We've just started the stream, wait for the first PTS. */
         block_Release( p_block );