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.
This commit is contained in:
Rodger Combs 2016-03-30 20:55:32 -05:00
parent 1b9e90ee80
commit b4daa2c40f
4 changed files with 10 additions and 0 deletions

1
configure vendored
View File

@ -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"

View File

@ -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

View File

@ -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);

View File

@ -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)