audio_date_t end_date;
int i_last_block_size;
+ int i_input_rate;
+
/*
** Channel reordering
*/
p_sys->i_last_block_size = 0;
p_sys->b_packetizer = VLC_FALSE;
p_sys->i_headers = 0;
+ p_sys->i_input_rate = INPUT_RATE_DEFAULT;
/* Take care of vorbis init */
vorbis_info_init( &p_sys->vi );
/* Block to Ogg packet */
oggpacket.packet = (*pp_block)->p_buffer;
oggpacket.bytes = (*pp_block)->i_buffer;
+
+ if( (*pp_block)->i_rate > 0 )
+ p_sys->i_input_rate = (*pp_block)->i_rate;
}
else
{
/* Date management */
p_aout_buffer->start_date = aout_DateGet( &p_sys->end_date );
p_aout_buffer->end_date = aout_DateIncrement( &p_sys->end_date,
- i_samples );
+ i_samples * p_sys->i_input_rate / INPUT_RATE_DEFAULT );
return p_aout_buffer;
}
else
p_block->i_dts = p_block->i_pts = aout_DateGet( &p_sys->end_date );
if( p_sys->i_headers >= 3 )
- p_block->i_length = aout_DateIncrement( &p_sys->end_date, i_samples ) -
- p_block->i_pts;
+ p_block->i_length = aout_DateIncrement( &p_sys->end_date,
+ i_samples * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) -
+ p_block->i_pts;
else
p_block->i_length = 0;
psz_value );
}
}
+ else if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_GAIN" ) ||
+ !strcasecmp( psz_name, "RG_RADIO" ) )
+ {
+ audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
+
+ r->pb_gain[AUDIO_REPLAY_GAIN_TRACK] = VLC_TRUE;
+ r->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
+ }
+ else if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_PEAK" ) ||
+ !strcasecmp( psz_name, "RG_PEAK" ) )
+ {
+ audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
+
+ r->pb_peak[AUDIO_REPLAY_GAIN_TRACK] = VLC_TRUE;
+ r->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
+ }
+ else if( !strcasecmp( psz_name, "REPLAYGAIN_ALBUM_GAIN" ) ||
+ !strcasecmp( psz_name, "RG_AUDIOPHILE" ) )
+ {
+ audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
+
+ r->pb_gain[AUDIO_REPLAY_GAIN_ALBUM] = VLC_TRUE;
+ r->pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
+ }
+ else if( !strcasecmp( psz_name, "REPLAYGAIN_ALBUM_PEAK" ) )
+ {
+ audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
+
+ r->pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = VLC_TRUE;
+ r->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
+ }
#if 0 //not used
else if( !strcasecmp( psz_name, "musicbrainz_artistid" ) )
{