[vlc-commits] fdkaac: simplify profile selection

Rafaël Carré git at videolan.org
Sat May 3 18:00:01 CEST 2014


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri May  2 12:38:43 2014 +0200| [f9f9ff6112f9bf6e16659081c94a5f4d402e8a29] | committer: Rafaël Carré

fdkaac: simplify profile selection

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f9f9ff6112f9bf6e16659081c94a5f4d402e8a29
---

 modules/codec/fdkaac.c |   29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/modules/codec/fdkaac.c b/modules/codec/fdkaac.c
index 558c608..6a7c153 100644
--- a/modules/codec/fdkaac.c
+++ b/modules/codec/fdkaac.c
@@ -187,14 +187,11 @@ static int OpenEncoder( vlc_object_t *p_this )
     encoder_sys_t *p_sys;
     CHANNEL_MODE mode;
     AACENC_ERROR erraac;
-    bool b_profile_selected;
     int sce;
     int cpe;
-    int i_profile;
     int i_bitrate;
 
     p_enc = (encoder_t *)p_this;
-    b_profile_selected = false;
     sce = 0;
     cpe = 0;
 
@@ -205,21 +202,6 @@ static int OpenEncoder( vlc_object_t *p_this )
     {
         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;
     switch (p_enc->fmt_in.audio.i_channels) {
@@ -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 );
 
-    if ( b_profile_selected == false )
-        p_sys->i_aot = var_InheritInteger( p_enc, ENC_CFG_PREFIX "profile" );
+    if ( p_enc->fmt_out.i_codec == VLC_FOURCC( 'l', 'a', 'a', 'c' ) )
+        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
-        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->i_vbr = var_InheritInteger( p_enc, ENC_CFG_PREFIX "vbr" );
     p_sys->b_afterburner = var_InheritBool( p_enc, ENC_CFG_PREFIX "afterburner" );



More information about the vlc-commits mailing list