Commit 79bd7201 authored by Rafaël Carré's avatar Rafaël Carré

When specifying --sout-transcode-samplerate and --sout-transcode-channel, set...

When specifying --sout-transcode-samplerate and --sout-transcode-channel, set the OUTPUT format instead of the INPUT

Fix resampling when using mp4a (faac is the only option atm)
parent da99cadb
...@@ -565,15 +565,20 @@ int E_(OpenEncoder)( vlc_object_t *p_this ) ...@@ -565,15 +565,20 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_enc->fmt_in.audio.i_channels = 2; p_enc->fmt_in.audio.i_channels = 2;
p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE; p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
p_context->sample_rate = p_enc->fmt_in.audio.i_rate; p_context->sample_rate = p_enc->fmt_out.audio.i_rate;
p_context->channels = p_enc->fmt_in.audio.i_channels; p_context->channels = p_enc->fmt_out.audio.i_channels;
if ( p_enc->fmt_out.i_codec == VLC_FOURCC('m','p','4','a') )
{
/* XXX: FAAC does resample only when setting the INPUT samplerate
* to the desired value (-R option of the faac frontend) */
p_enc->fmt_in.audio.i_rate = p_context->sample_rate;
#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(40<<8)+4) #if LIBAVCODEC_VERSION_INT >= ((51<<16)+(40<<8)+4)
/* Ignore FF_PROFILE_UNKNOWN */ /* Ignore FF_PROFILE_UNKNOWN */
if( ( p_sys->i_aac_profile >= FF_PROFILE_AAC_MAIN ) && if( p_sys->i_aac_profile >= FF_PROFILE_AAC_MAIN )
( p_enc->fmt_out.i_codec == VLC_FOURCC('m','p','4','a') ) )
p_context->profile = p_sys->i_aac_profile; p_context->profile = p_sys->i_aac_profile;
#endif #endif
}
} }
/* Misc parameters */ /* Misc parameters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment