diff options
author | jstebbins <[email protected]> | 2014-03-01 02:57:44 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-03-01 02:57:44 +0000 |
commit | f5dca4423f400948bc33a540af5728d3c0ca8d32 (patch) | |
tree | 49bb814bdb0e4988a4a4030adc4c88b7462f8dac /libhb/common.c | |
parent | 733bdedc5f71442c535a8bcc1c239d77c7b15036 (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
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 16 |
1 files changed, 9 insertions, 7 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: |