/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h>
#include <vlc/vlc.h>
#include <vlc_block.h>
if( p_dec == NULL )
{
msg_Err( p_input, "could not create packetizer" );
- intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"),
+ intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"),
_("VLC could not open the packetizer module.") );
return NULL;
}
if( p_dec == NULL )
{
msg_Err( p_input, "could not create decoder" );
- intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"),
+ intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"),
_("VLC could not open the decoder module.") );
return NULL;
}
}
}
+ /* Copy ourself the input replay gain */
+ if( fmt->i_cat == AUDIO_ES )
+ {
+ int i;
+ for( i = 0; i < AUDIO_REPLAY_GAIN_MAX; i++ )
+ {
+ if( !p_dec->fmt_out.audio_replay_gain.pb_peak[i] )
+ {
+ p_dec->fmt_out.audio_replay_gain.pb_peak[i] = fmt->audio_replay_gain.pb_peak[i];
+ p_dec->fmt_out.audio_replay_gain.pf_peak[i] = fmt->audio_replay_gain.pf_peak[i];
+ }
+ if( !p_dec->fmt_out.audio_replay_gain.pb_gain[i] )
+ {
+ p_dec->fmt_out.audio_replay_gain.pb_gain[i] = fmt->audio_replay_gain.pb_gain[i];
+ p_dec->fmt_out.audio_replay_gain.pf_gain[i] = fmt->audio_replay_gain.pf_gain[i];
+ }
+ }
+ }
return p_dec;
}
}
p_sys->p_aout_input =
- aout_DecNew( p_dec, &p_sys->p_aout, &format );
+ aout_DecNew( p_dec, &p_sys->p_aout, &format, &p_dec->fmt_out.audio_replay_gain );
if( p_sys->p_aout_input == NULL )
{
msg_Err( p_dec, "failed to create audio output" );