diff faac.c @ 4891:8cd8fd35b6aa libavcodec

add the possibility to choose aac profile patch by Nicolas George nicolas george chez normalesup org original thread: [Ffmpeg-devel] [PATCH] FAAC profile selection date: 04/27/2007 08:11 PM
author benoit
date Wed, 02 May 2007 13:49:08 +0000
parents d77c5a6824e4
children 160536e80ee6
line wrap: on
line diff
--- a/faac.c	Wed May 02 09:37:47 2007 +0000
+++ b/faac.c	Wed May 02 13:49:08 2007 +0000
@@ -54,7 +54,25 @@
     }
 
     /* put the options in the configuration struct */
-    faac_cfg->aacObjectType = LOW;
+    switch(avctx->profile) {
+        case FF_PROFILE_AAC_MAIN:
+            faac_cfg->aacObjectType = MAIN;
+            break;
+        case FF_PROFILE_UNKNOWN:
+        case FF_PROFILE_AAC_LOW:
+            faac_cfg->aacObjectType = LOW;
+            break;
+        case FF_PROFILE_AAC_SSR:
+            faac_cfg->aacObjectType = SSR;
+            break;
+        case FF_PROFILE_AAC_LTP:
+            faac_cfg->aacObjectType = LTP;
+            break;
+        default:
+            av_log(avctx, AV_LOG_ERROR, "invalid AAC profile\n");
+            faacEncClose(s->faac_handle);
+            return -1;
+    }
     faac_cfg->mpegVersion = MPEG4;
     faac_cfg->useTns = 0;
     faac_cfg->allowMidside = 1;