Commit b8813031 authored by Laurent Aimar's avatar Laurent Aimar

Used date_t instead of audio_date_t in codecs.

parent 09d375d4
...@@ -77,7 +77,7 @@ struct decoder_sys_t ...@@ -77,7 +77,7 @@ struct decoder_sys_t
/* /*
* Common properties * Common properties
*/ */
audio_date_t end_date; date_t end_date;
mtime_t i_pts; mtime_t i_pts;
...@@ -136,7 +136,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer ) ...@@ -136,7 +136,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
/* Misc init */ /* Misc init */
p_sys->b_packetizer = b_packetizer; p_sys->b_packetizer = b_packetizer;
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
p_sys->bytestream = block_BytestreamInit(); p_sys->bytestream = block_BytestreamInit();
...@@ -187,12 +187,12 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -187,12 +187,12 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
} }
if( !aout_DateGet( &p_sys->end_date ) && !(*pp_block)->i_pts ) if( !date_Get( &p_sys->end_date ) && !(*pp_block)->i_pts )
{ {
/* We've just started the stream, wait for the first PTS. */ /* We've just started the stream, wait for the first PTS. */
block_Release( *pp_block ); block_Release( *pp_block );
...@@ -228,9 +228,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -228,9 +228,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* New frame, set the Presentation Time Stamp */ /* New frame, set the Presentation Time Stamp */
p_sys->i_pts = p_sys->bytestream.p_block->i_pts; p_sys->i_pts = p_sys->bytestream.p_block->i_pts;
if( p_sys->i_pts != 0 && if( p_sys->i_pts != 0 &&
p_sys->i_pts != aout_DateGet( &p_sys->end_date ) ) p_sys->i_pts != date_Get( &p_sys->end_date ) )
{ {
aout_DateSet( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, p_sys->i_pts );
} }
p_sys->i_state = STATE_HEADER; p_sys->i_state = STATE_HEADER;
...@@ -350,8 +350,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer ) ...@@ -350,8 +350,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
msg_Info( p_dec, "A/52 channels:%d samplerate:%d bitrate:%d", msg_Info( p_dec, "A/52 channels:%d samplerate:%d bitrate:%d",
p_sys->frame.i_channels, p_sys->frame.i_rate, p_sys->frame.i_bitrate ); p_sys->frame.i_channels, p_sys->frame.i_rate, p_sys->frame.i_bitrate );
aout_DateInit( &p_sys->end_date, p_sys->frame.i_rate ); date_Init( &p_sys->end_date, p_sys->frame.i_rate, 1 );
aout_DateSet( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, p_sys->i_pts );
} }
p_dec->fmt_out.audio.i_rate = p_sys->frame.i_rate; p_dec->fmt_out.audio.i_rate = p_sys->frame.i_rate;
...@@ -393,8 +393,8 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec ) ...@@ -393,8 +393,8 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
p_buf = decoder_NewAudioBuffer( p_dec, p_sys->frame.i_samples ); p_buf = decoder_NewAudioBuffer( p_dec, p_sys->frame.i_samples );
if( p_buf == NULL ) return NULL; if( p_buf == NULL ) return NULL;
p_buf->start_date = aout_DateGet( &p_sys->end_date ); p_buf->start_date = date_Get( &p_sys->end_date );
p_buf->end_date = aout_DateIncrement( &p_sys->end_date, p_sys->frame.i_samples ); p_buf->end_date = date_Increment( &p_sys->end_date, p_sys->frame.i_samples );
return p_buf; return p_buf;
} }
...@@ -410,10 +410,10 @@ static block_t *GetSoutBuffer( decoder_t *p_dec ) ...@@ -410,10 +410,10 @@ static block_t *GetSoutBuffer( decoder_t *p_dec )
p_block = block_New( p_dec, p_sys->frame.i_size ); p_block = block_New( p_dec, p_sys->frame.i_size );
if( p_block == NULL ) return NULL; if( p_block == NULL ) return NULL;
p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date ); p_block->i_pts = p_block->i_dts = date_Get( &p_sys->end_date );
p_block->i_length = p_block->i_length =
aout_DateIncrement( &p_sys->end_date, p_sys->frame.i_samples ) - p_block->i_pts; date_Increment( &p_sys->end_date, p_sys->frame.i_samples ) - p_block->i_pts;
return p_block; return p_block;
} }
......
...@@ -72,7 +72,7 @@ struct decoder_sys_t ...@@ -72,7 +72,7 @@ struct decoder_sys_t
size_t i_block; size_t i_block;
size_t i_samplesperblock; size_t i_samplesperblock;
audio_date_t end_date; date_t end_date;
}; };
static void DecodeAdpcmMs ( decoder_t *, int16_t *, uint8_t * ); static void DecodeAdpcmMs ( decoder_t *, int16_t *, uint8_t * );
...@@ -254,8 +254,8 @@ static int OpenDecoder( vlc_object_t *p_this ) ...@@ -254,8 +254,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec->fmt_out.audio.i_original_channels = p_dec->fmt_out.audio.i_original_channels =
pi_channels_maps[p_dec->fmt_in.audio.i_channels]; pi_channels_maps[p_dec->fmt_in.audio.i_channels];
aout_DateInit( &p_sys->end_date, p_dec->fmt_out.audio.i_rate ); date_Init( &p_sys->end_date, p_dec->fmt_out.audio.i_rate, 1 );
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
p_dec->pf_decode_audio = DecodeBlock; p_dec->pf_decode_audio = DecodeBlock;
...@@ -275,11 +275,11 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -275,11 +275,11 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_pts != 0 && 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. */ /* We've just started the stream, wait for the first PTS. */
block_Release( p_block ); block_Release( p_block );
...@@ -300,9 +300,9 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -300,9 +300,9 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
p_out->start_date = aout_DateGet( &p_sys->end_date ); p_out->start_date = date_Get( &p_sys->end_date );
p_out->end_date = p_out->end_date =
aout_DateIncrement( &p_sys->end_date, p_sys->i_samplesperblock ); date_Increment( &p_sys->end_date, p_sys->i_samplesperblock );
switch( p_sys->codec ) switch( p_sys->codec )
{ {
......
...@@ -64,7 +64,7 @@ struct decoder_sys_t ...@@ -64,7 +64,7 @@ struct decoder_sys_t
/* /*
* Output properties * Output properties
*/ */
audio_date_t end_date; date_t end_date;
}; };
#define AES3_HEADER_LEN 4 #define AES3_HEADER_LEN 4
...@@ -134,8 +134,8 @@ static aout_buffer_t *Decode( decoder_t *p_dec, block_t **pp_block ) ...@@ -134,8 +134,8 @@ static aout_buffer_t *Decode( decoder_t *p_dec, block_t **pp_block )
if( p_aout_buffer == NULL ) if( p_aout_buffer == NULL )
goto exit; goto exit;
p_aout_buffer->start_date = aout_DateGet( &p_sys->end_date ); p_aout_buffer->start_date = date_Get( &p_sys->end_date );
p_aout_buffer->end_date = aout_DateIncrement( &p_sys->end_date, i_frame_length ); p_aout_buffer->end_date = date_Increment( &p_sys->end_date, i_frame_length );
p_block->i_buffer -= AES3_HEADER_LEN; p_block->i_buffer -= AES3_HEADER_LEN;
p_block->p_buffer += AES3_HEADER_LEN; p_block->p_buffer += AES3_HEADER_LEN;
...@@ -219,8 +219,8 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -219,8 +219,8 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
if( !p_block ) if( !p_block )
return NULL; return NULL;
p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date ); p_block->i_pts = p_block->i_dts = date_Get( &p_sys->end_date );
p_block->i_length = aout_DateIncrement( &p_sys->end_date, i_frame_length ) - p_block->i_pts; p_block->i_length = date_Increment( &p_sys->end_date, i_frame_length ) - p_block->i_pts;
/* Just pass on the incoming frame */ /* Just pass on the incoming frame */
return p_block; return p_block;
...@@ -243,8 +243,8 @@ static int Open( decoder_t *p_dec, bool b_packetizer ) ...@@ -243,8 +243,8 @@ static int Open( decoder_t *p_dec, bool b_packetizer )
return VLC_EGENERIC; return VLC_EGENERIC;
/* Misc init */ /* Misc init */
aout_DateInit( &p_sys->end_date, 48000 ); date_Init( &p_sys->end_date, 48000, 1 );
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
/* Set output properties */ /* Set output properties */
p_dec->fmt_out.i_cat = AUDIO_ES; p_dec->fmt_out.i_cat = AUDIO_ES;
...@@ -297,12 +297,12 @@ static block_t *Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits, ...@@ -297,12 +297,12 @@ static block_t *Parse( decoder_t *p_dec, int *pi_frame_length, int *pi_bits,
/* Date management */ /* Date management */
if( p_block->i_pts > 0 && 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 );
} }
if( !aout_DateGet( &p_sys->end_date ) ) if( !date_Get( &p_sys->end_date ) )
{ {
/* We've just started the stream, wait for the first PTS. */ /* We've just started the stream, wait for the first PTS. */
block_Release( p_block ); block_Release( p_block );
......
...@@ -74,7 +74,7 @@ struct decoder_sys_t ...@@ -74,7 +74,7 @@ struct decoder_sys_t
const int16_t *p_logtos16; /* used with m/alaw to int16_t */ const int16_t *p_logtos16; /* used with m/alaw to int16_t */
int i_bytespersample; int i_bytespersample;
audio_date_t end_date; date_t end_date;
}; };
static const int pi_channels_maps[] = static const int pi_channels_maps[] =
...@@ -311,8 +311,8 @@ static int DecoderOpen( vlc_object_t *p_this ) ...@@ -311,8 +311,8 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec->fmt_out.audio.i_bitspersample = 16; p_dec->fmt_out.audio.i_bitspersample = 16;
} }
aout_DateInit( &p_sys->end_date, p_dec->fmt_out.audio.i_rate ); date_Init( &p_sys->end_date, p_dec->fmt_out.audio.i_rate, 1 );
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
p_sys->i_bytespersample = ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8; p_sys->i_bytespersample = ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8;
p_dec->pf_decode_audio = DecodeBlock; p_dec->pf_decode_audio = DecodeBlock;
...@@ -337,11 +337,11 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -337,11 +337,11 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_block = *pp_block; p_block = *pp_block;
if( p_block->i_pts != 0 && 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. */ /* We've just started the stream, wait for the first PTS. */
block_Release( p_block ); block_Release( p_block );
...@@ -370,8 +370,8 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -370,8 +370,8 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
return NULL; return NULL;
} }
p_out->start_date = aout_DateGet( &p_sys->end_date ); p_out->start_date = date_Get( &p_sys->end_date );
p_out->end_date = aout_DateIncrement( &p_sys->end_date, i_samples ); p_out->end_date = date_Increment( &p_sys->end_date, i_samples );
if( p_sys->p_logtos16 ) if( p_sys->p_logtos16 )
{ {
......
...@@ -60,7 +60,7 @@ struct decoder_sys_t ...@@ -60,7 +60,7 @@ struct decoder_sys_t
* Output properties * Output properties
*/ */
audio_sample_format_t aout_format; audio_sample_format_t aout_format;
audio_date_t end_date; date_t end_date;
/* /*
* *
...@@ -207,9 +207,9 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -207,9 +207,9 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->i_previous_channels = 0; p_sys->i_previous_channels = 0;
p_sys->i_previous_layout = 0; p_sys->i_previous_layout = 0;
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
if( p_dec->fmt_in.audio.i_rate ) if( p_dec->fmt_in.audio.i_rate )
aout_DateInit( &p_sys->end_date, p_dec->fmt_in.audio.i_rate ); date_Init( &p_sys->end_date, p_dec->fmt_in.audio.i_rate, 1 );
/* */ /* */
p_dec->fmt_out.i_cat = AUDIO_ES; p_dec->fmt_out.i_cat = AUDIO_ES;
...@@ -234,8 +234,8 @@ static aout_buffer_t *SplitBuffer( decoder_t *p_dec ) ...@@ -234,8 +234,8 @@ static aout_buffer_t *SplitBuffer( decoder_t *p_dec )
if( ( p_buffer = decoder_NewAudioBuffer( p_dec, i_samples ) ) == NULL ) if( ( p_buffer = decoder_NewAudioBuffer( p_dec, i_samples ) ) == NULL )
return NULL; return NULL;
p_buffer->start_date = aout_DateGet( &p_sys->end_date ); p_buffer->start_date = date_Get( &p_sys->end_date );
p_buffer->end_date = aout_DateIncrement( &p_sys->end_date, i_samples ); p_buffer->end_date = date_Increment( &p_sys->end_date, i_samples );
if( p_sys->b_extract ) if( p_sys->b_extract )
aout_ChannelExtract( p_buffer->p_buffer, p_dec->fmt_out.audio.i_channels, aout_ChannelExtract( p_buffer->p_buffer, p_dec->fmt_out.audio.i_channels,
...@@ -269,7 +269,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) ...@@ -269,7 +269,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
block_Release( p_block ); block_Release( p_block );
avcodec_flush_buffers( p_sys->p_context ); avcodec_flush_buffers( p_sys->p_context );
p_sys->i_samples = 0; p_sys->i_samples = 0;
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
if( p_sys->i_codec_id == CODEC_ID_MP2 || p_sys->i_codec_id == CODEC_ID_MP3 ) if( p_sys->i_codec_id == CODEC_ID_MP2 || p_sys->i_codec_id == CODEC_ID_MP3 )
p_sys->i_reject_count = 3; p_sys->i_reject_count = 3;
...@@ -284,7 +284,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) ...@@ -284,7 +284,7 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
return p_buffer; return p_buffer;
} }
if( !aout_DateGet( &p_sys->end_date ) && !p_block->i_pts ) if( !date_Get( &p_sys->end_date ) && !p_block->i_pts )
{ {
/* We've just started the stream, wait for the first PTS. */ /* We've just started the stream, wait for the first PTS. */
block_Release( p_block ); block_Release( p_block );
...@@ -348,17 +348,17 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block ) ...@@ -348,17 +348,17 @@ aout_buffer_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
if( p_dec->fmt_out.audio.i_rate != (unsigned int)p_sys->p_context->sample_rate ) if( p_dec->fmt_out.audio.i_rate != (unsigned int)p_sys->p_context->sample_rate )
{ {
aout_DateInit( &p_sys->end_date, p_sys->p_context->sample_rate ); date_Init( &p_sys->end_date, p_sys->p_context->sample_rate, 1 );
aout_DateSet( &p_sys->end_date, p_block->i_pts ); date_Set( &p_sys->end_date, p_block->i_pts );
} }
/* **** Set audio output parameters **** */ /* **** Set audio output parameters **** */
SetupOutputFormat( p_dec, true ); SetupOutputFormat( p_dec, true );
if( p_block->i_pts != 0 && 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 );
} }
p_block->i_pts = 0; p_block->i_pts = 0;
......
...@@ -73,7 +73,7 @@ struct decoder_sys_t ...@@ -73,7 +73,7 @@ struct decoder_sys_t
/* /*
* Common properties * Common properties
*/ */
audio_date_t end_date; date_t end_date;
mtime_t i_pts; mtime_t i_pts;
...@@ -150,7 +150,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer ) ...@@ -150,7 +150,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
/* Misc init */ /* Misc init */
p_sys->b_packetizer = b_packetizer; p_sys->b_packetizer = b_packetizer;
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
p_sys->b_dts_hd = false; p_sys->b_dts_hd = false;
p_sys->bytestream = block_BytestreamInit(); p_sys->bytestream = block_BytestreamInit();
...@@ -189,12 +189,12 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -189,12 +189,12 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys->i_state = STATE_NOSYNC; p_sys->i_state = STATE_NOSYNC;
block_BytestreamEmpty( &p_sys->bytestream ); block_BytestreamEmpty( &p_sys->bytestream );
} }
aout_DateSet( &p_sys->end_date, 0 ); date_Set( &p_sys->end_date, 0 );
block_Release( *pp_block ); block_Release( *pp_block );
return NULL; return NULL;
} }
if( !aout_DateGet( &p_sys->end_date ) && !(*pp_block)->i_pts ) if( !date_Get( &p_sys->end_date ) && !(*pp_block)->i_pts )
{ {
/* We've just started the stream, wait for the first PTS. */ /* We've just started the stream, wait for the first PTS. */
block_Release( *pp_block ); block_Release( *pp_block );
...@@ -231,9 +231,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -231,9 +231,9 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* New frame, set the Presentation Time Stamp */ /* New frame, set the Presentation Time Stamp */
p_sys->i_pts = p_sys->bytestream.p_block->i_pts; p_sys->i_pts = p_sys->bytestream.p_block->i_pts;
if( p_sys->i_pts != 0 && if( p_sys->i_pts != 0 &&
p_sys->i_pts != aout_DateGet( &p_sys->end_date ) ) p_sys->i_pts != date_Get( &p_sys->end_date ) )
{ {
aout_DateSet( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, p_sys->i_pts );
} }
p_sys->i_state = STATE_HEADER; p_sys->i_state = STATE_HEADER;
...@@ -361,8 +361,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer ) ...@@ -361,8 +361,8 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
msg_Info( p_dec, "DTS channels:%d samplerate:%d bitrate:%d", msg_Info( p_dec, "DTS channels:%d samplerate:%d bitrate:%d",
p_sys->i_channels, p_sys->i_rate, p_sys->i_bit_rate ); p_sys->i_channels, p_sys->i_rate, p_sys->i_bit_rate );
aout_DateInit( &p_sys->end_date, p_sys->i_rate ); date_Init( &p_sys->end_date, p_sys->i_rate, 1 );
aout_DateSet( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, p_sys->i_pts );
} }
p_dec->fmt_out.audio.i_rate = p_sys->i_rate; p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
...@@ -409,9 +409,9 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec ) ...@@ -409,9 +409,9 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
p_buf->i_nb_samples = p_sys->i_frame_length; p_buf->i_nb_samples = p_sys->i_frame_length;
p_buf->i_nb_bytes = p_sys->i_frame_size; p_buf->i_nb_bytes = p_sys->i_frame_size;
p_buf->start_date = aout_DateGet( &p_sys->end_date ); p_buf->start_date = date_Get( &p_sys->end_date );
p_buf->end_date = p_buf->end_date =
aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ); date_Increment( &p_sys->end_date, p_sys->i_frame_length );
return p_buf; return p_buf;
} }
...@@ -427,9 +427,9 @@ static block_t *GetSoutBuffer( decoder_t *p_dec ) ...@@ -427,9 +427,9 @@ static block_t *GetSoutBuffer( decoder_t *p_dec )
p_block = block_New( p_dec, p_sys->i_frame_size ); p_block = block_New( p_dec, p_sys->i_frame_size );
if( p_block == NULL ) return NULL; if( p_block == NULL ) return NULL;
p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date ); p_block->i_pts = p_block->i_dts = date_Get( &p_sys->end_date );
p_block->i_length = aout_DateIncrement( &p_sys->end_date, p_block->i_length = date_Increment( &p_sys->end_date,
p_sys->i_frame_length ) - p_block->i_pts; p_sys->i_frame_length ) - p_block->i_pts;
return p_block; return p_block;
......
...@@ -62,7 +62,7 @@ struct decoder_sys_t ...@@ -62,7 +62,7 @@ struct decoder_sys_t
faacDecHandle *hfaad; faacDecHandle *hfaad;
/* samples */ /* samples */
audio_date_t date; date_t date;
/* temporary buffer */ /* temporary buffer */
uint8_t *p_buffer; uint8_t *p_buffer;
...@@ -134,7 +134,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -134,7 +134,7 @@ static int Open( vlc_object_t *p_this )
} }
/* Misc init */ /* Misc init */
aout_DateSet( &p_sys->date, 0 ); date_Set( &p_sys->date, 0 );
p_dec->fmt_out.i_cat = AUDIO_ES; p_dec->fmt_out.i_cat = AUDIO_ES;
if (vlc_CPU() & CPU_CAPABILITY_FPU) if (vlc_CPU() & CPU_CAPABILITY_FPU)
...@@ -165,7 +165,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -165,7 +165,7 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_out.audio.i_physical_channels p_dec->fmt_out.audio.i_physical_channels
= p_dec->fmt_out.audio.i_original_channels = p_dec->fmt_out.audio.i_original_channels
= pi_channels_guessed[i_channels]; = pi_channels_guessed[i_channels];
aout_DateInit( &p_sys->date, i_rate ); date_Init( &p_sys->date, i_rate, 1 );
} }
else else
{ {
...@@ -261,7 +261,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -261,7 +261,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
= p_dec->fmt_out.audio.i_original_channels = p_dec->fmt_out.audio.i_original_channels
= pi_channels_guessed[i_channels]; = pi_channels_guessed[i_channels];
aout_DateInit( &p_sys->date, i_rate ); date_Init( &p_sys->date, i_rate, 1 );
} }
} }
...@@ -284,14 +284,14 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -284,14 +284,14 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_dec->fmt_out.audio.i_physical_channels p_dec->fmt_out.audio.i_physical_channels
= p_dec->fmt_out.audio.i_original_channels = p_dec->fmt_out.audio.i_original_channels
= pi_channels_guessed[i_channels]; = pi_channels_guessed[i_channels];
aout_DateInit( &p_sys->date, i_rate ); date_Init( &p_sys->date, i_rate, 1 );
} }