diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2016-03-30 20:55:32 -0500 |
---|---|---|
committer | Rodger Combs <rodger.combs@gmail.com> | 2016-04-02 03:03:13 -0500 |
commit | b4daa2c40fb77974af6814cc0baaeec6a7481101 (patch) | |
tree | f3befd21db0f57552b793d0eb8c36156173c2544 | |
parent | 1b9e90ee80be92c8e14349a8fc74b4560a46e648 (diff) | |
download | ffmpeg-b4daa2c40fb77974af6814cc0baaeec6a7481101.tar.gz |
lavc/audiotoolboxdec: add eac3 decoder
This is added in 10.11, so we add a #define when building against older SDKs.
The decoder actually supports 7.1-channel eac3, but since the parser only
reports 6 channels, we end up decoding the 5.1 downmix (same as the internal
decoder) for now.
-rwxr-xr-x | configure | 1 | ||||
-rw-r--r-- | libavcodec/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/allcodecs.c | 1 | ||||
-rw-r--r-- | libavcodec/audiotoolboxdec.c | 7 |
4 files changed, 10 insertions, 0 deletions
@@ -2650,6 +2650,7 @@ ac3_at_decoder_deps="audiotoolbox" adpcm_ima_qt_at_decoder_deps="audiotoolbox" alac_at_decoder_deps="audiotoolbox" amr_nb_at_decoder_deps="audiotoolbox" +eac3_at_decoder_deps="audiotoolbox" gsm_ms_at_decoder_deps="audiotoolbox" ilbc_at_decoder_deps="audiotoolbox" mp1_at_decoder_deps="audiotoolbox" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 8c14268701..801cccd374 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -806,6 +806,7 @@ OBJS-$(CONFIG_AC3_AT_DECODER) += audiotoolboxdec.o OBJS-$(CONFIG_ADPCM_IMA_QT_AT_DECODER) += audiotoolboxdec.o OBJS-$(CONFIG_ALAC_AT_DECODER) += audiotoolboxdec.o OBJS-$(CONFIG_AMR_NB_AT_DECODER) += audiotoolboxdec.o +OBJS-$(CONFIG_EAC3_AT_DECODER) += audiotoolboxdec.o OBJS-$(CONFIG_GSM_MS_AT_DECODER) += audiotoolboxdec.o OBJS-$(CONFIG_ILBC_AT_DECODER) += audiotoolboxdec.o OBJS-$(CONFIG_MP1_AT_DECODER) += audiotoolboxdec.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index f498041bd4..0bbf7d317c 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -568,6 +568,7 @@ void avcodec_register_all(void) REGISTER_DECODER(ADPCM_IMA_QT_AT, adpcm_ima_qt_at); REGISTER_ENCDEC (ALAC_AT, alac_at); REGISTER_DECODER(AMR_NB_AT, amr_nb_at); + REGISTER_DECODER(EAC3_AT, eac3_at); REGISTER_DECODER(GSM_MS_AT, gsm_ms_at); REGISTER_ENCDEC (ILBC_AT, ilbc_at); REGISTER_DECODER(MP1_AT, mp1_at); diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 4ff46eae3e..f840a6ba42 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -30,6 +30,10 @@ #include "libavutil/opt.h" #include "libavutil/log.h" +#ifndef __MAC_10_11 +#define kAudioFormatEnhancedAC3 'ec-3' +#endif + typedef struct ATDecodeContext { AVClass *av_class; @@ -58,6 +62,8 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile) return kAudioFormatAppleLossless; case AV_CODEC_ID_AMR_NB: return kAudioFormatAMR; + case AV_CODEC_ID_EAC3: + return kAudioFormatEnhancedAC3; case AV_CODEC_ID_GSM_MS: return kAudioFormatMicrosoftGSM; case AV_CODEC_ID_ILBC: @@ -512,6 +518,7 @@ FFAT_DEC(ac3, AV_CODEC_ID_AC3) FFAT_DEC(adpcm_ima_qt, AV_CODEC_ID_ADPCM_IMA_QT) FFAT_DEC(alac, AV_CODEC_ID_ALAC) FFAT_DEC(amr_nb, AV_CODEC_ID_AMR_NB) +FFAT_DEC(eac3, AV_CODEC_ID_EAC3) FFAT_DEC(gsm_ms, AV_CODEC_ID_GSM_MS) FFAT_DEC(ilbc, AV_CODEC_ID_ILBC) FFAT_DEC(mp1, AV_CODEC_ID_MP1) |