summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-03-01 02:57:44 +0000
committerjstebbins <[email protected]>2014-03-01 02:57:44 +0000
commitf5dca4423f400948bc33a540af5728d3c0ca8d32 (patch)
tree49bb814bdb0e4988a4a4030adc4c88b7462f8dac
parent733bdedc5f71442c535a8bcc1c239d77c7b15036 (diff)
libhb: dynamic detection of availability of libav audio encoders
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6089 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/common.c16
-rw-r--r--libhb/module.defs4
2 files changed, 9 insertions, 11 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 6e37c1c31..b3291c2b2 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -292,21 +292,23 @@ static int hb_audio_encoder_is_enabled(int encoder)
#ifdef USE_LIBAV_AAC
case HB_ACODEC_FFAAC:
- return 1;
+ return avcodec_find_encoder_by_name("aac") != NULL;
#endif
-#ifdef USE_FDK_AAC
case HB_ACODEC_FDK_AAC:
case HB_ACODEC_FDK_HAAC:
- return 1;
-#endif
+ return avcodec_find_encoder_by_name("libfdk_aac") != NULL;
- // the following encoders are always enabled
- case HB_ACODEC_LAME:
- case HB_ACODEC_VORBIS:
case HB_ACODEC_AC3:
+ return avcodec_find_encoder(AV_CODEC_ID_AC3) != NULL;
+
case HB_ACODEC_FFFLAC:
case HB_ACODEC_FFFLAC24:
+ return avcodec_find_encoder(AV_CODEC_ID_FLAC) != NULL;
+
+ // the following encoders are always enabled
+ case HB_ACODEC_LAME:
+ case HB_ACODEC_VORBIS:
return 1;
default:
diff --git a/libhb/module.defs b/libhb/module.defs
index 6cefac706..02279befd 100644
--- a/libhb/module.defs
+++ b/libhb/module.defs
@@ -35,10 +35,6 @@ LIBHB.out += $(LIBHB.a)
###############################################################################
-ifeq (1,$(FEATURE.fdk_aac))
-LIBHB.GCC.D += USE_FDK_AAC
-endif
-
ifeq (1,$(FEATURE.hwd))
LIBHB.GCC.D += USE_HWD
endif