]> git.sesse.net Git - vlc/blobdiff - modules/codec/araw.c
aout_buffer_t.start_data -> aout_buffer_t.i_pts
[vlc] / modules / codec / araw.c
index 4196a9ce129519c0efc9765cdca40d7f4a64dbec..b3200ab189fb65d6b872d4246715bdc12bdd4b06 100644 (file)
@@ -74,7 +74,7 @@ struct decoder_sys_t
     const int16_t *p_logtos16;  /* used with m/alaw to int16_t */
     int i_bytespersample;
 
-    audio_date_t end_date;
+    date_t end_date;
 };
 
 static const int pi_channels_maps[] =
@@ -311,8 +311,8 @@ static int DecoderOpen( vlc_object_t *p_this )
         p_dec->fmt_out.audio.i_bitspersample = 16;
     }
 
-    aout_DateInit( &p_sys->end_date, p_dec->fmt_out.audio.i_rate );
-    aout_DateSet( &p_sys->end_date, 0 );
+    date_Init( &p_sys->end_date, p_dec->fmt_out.audio.i_rate, 1 );
+    date_Set( &p_sys->end_date, 0 );
     p_sys->i_bytespersample = ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8;
 
     p_dec->pf_decode_audio = DecodeBlock;
@@ -337,11 +337,11 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_block = *pp_block;
 
     if( p_block->i_pts != 0 &&
-        p_block->i_pts != aout_DateGet( &p_sys->end_date ) )
+        p_block->i_pts != date_Get( &p_sys->end_date ) )
     {
-        aout_DateSet( &p_sys->end_date, p_block->i_pts );
+        date_Set( &p_sys->end_date, p_block->i_pts );
     }
-    else if( !aout_DateGet( &p_sys->end_date ) )
+    else if( !date_Get( &p_sys->end_date ) )
     {
         /* We've just started the stream, wait for the first PTS. */
         block_Release( p_block );
@@ -370,8 +370,8 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
-    p_out->start_date = aout_DateGet( &p_sys->end_date );
-    p_out->end_date   = aout_DateIncrement( &p_sys->end_date, i_samples );
+    p_out->i_pts = date_Get( &p_sys->end_date );
+    p_out->end_date   = date_Increment( &p_sys->end_date, i_samples );
 
     if( p_sys->p_logtos16 )
     {
@@ -1419,7 +1419,7 @@ static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
 
     if( p_block )
     {
-        p_block->i_dts = p_block->i_pts = p_aout_buf->start_date;
+        p_block->i_dts = p_block->i_pts = p_aout_buf->i_pts;
         p_block->i_length = (int64_t)p_aout_buf->i_nb_samples *
             (int64_t)1000000 / p_enc->fmt_in.audio.i_rate;
     }