Commit f9f9ff61 authored by Rafaël Carré's avatar Rafaël Carré

fdkaac: simplify profile selection

parent f31841cd
...@@ -187,14 +187,11 @@ static int OpenEncoder( vlc_object_t *p_this ) ...@@ -187,14 +187,11 @@ static int OpenEncoder( vlc_object_t *p_this )
encoder_sys_t *p_sys; encoder_sys_t *p_sys;
CHANNEL_MODE mode; CHANNEL_MODE mode;
AACENC_ERROR erraac; AACENC_ERROR erraac;
bool b_profile_selected;
int sce; int sce;
int cpe; int cpe;
int i_profile;
int i_bitrate; int i_bitrate;
p_enc = (encoder_t *)p_this; p_enc = (encoder_t *)p_this;
b_profile_selected = false;
sce = 0; sce = 0;
cpe = 0; cpe = 0;
...@@ -205,21 +202,6 @@ static int OpenEncoder( vlc_object_t *p_this ) ...@@ -205,21 +202,6 @@ static int OpenEncoder( vlc_object_t *p_this )
{ {
return VLC_EGENERIC; return VLC_EGENERIC;
} }
else if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 'l', 'a', 'a', 'c' ) )
{
b_profile_selected = true;
i_profile = PROFILE_AAC_LC;
}
else if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 'h', 'a', 'a', 'c' ) )
{
b_profile_selected = true;
i_profile = PROFILE_AAC_HE;
}
else if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 's', 'a', 'a', 'c' ) )
{
b_profile_selected = true;
i_profile = PROFILE_AAC_HE_v2;
}
uint16_t channel_config; uint16_t channel_config;
switch (p_enc->fmt_in.audio.i_channels) { switch (p_enc->fmt_in.audio.i_channels) {
...@@ -258,10 +240,15 @@ static int OpenEncoder( vlc_object_t *p_this ) ...@@ -258,10 +240,15 @@ static int OpenEncoder( vlc_object_t *p_this )
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg ); config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
if ( b_profile_selected == false ) if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 'l', 'a', 'a', 'c' ) )
p_sys->i_aot = var_InheritInteger( p_enc, ENC_CFG_PREFIX "profile" ); p_sys->i_aot = PROFILE_AAC_LC;
else if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 'h', 'a', 'a', 'c' ) )
p_sys->i_aot = PROFILE_AAC_HE;
else if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 's', 'a', 'a', 'c' ) )
p_sys->i_aot = PROFILE_AAC_HE_v2;
else else
p_sys->i_aot = i_profile; p_sys->i_aot = var_InheritInteger( p_enc, ENC_CFG_PREFIX "profile" );
p_sys->b_eld_sbr = var_InheritBool( p_enc, ENC_CFG_PREFIX "sbr" ); p_sys->b_eld_sbr = var_InheritBool( p_enc, ENC_CFG_PREFIX "sbr" );
p_sys->i_vbr = var_InheritInteger( p_enc, ENC_CFG_PREFIX "vbr" ); p_sys->i_vbr = var_InheritInteger( p_enc, ENC_CFG_PREFIX "vbr" );
p_sys->b_afterburner = var_InheritBool( p_enc, ENC_CFG_PREFIX "afterburner" ); p_sys->b_afterburner = var_InheritBool( p_enc, ENC_CFG_PREFIX "afterburner" );
......
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