lavd/avfoundation: Add support for 16bit integer input.

Reviewed-by: Thilo Borgmann
This commit is contained in:
Carl Eugen Hoyos 2015-03-06 01:06:57 +01:00
parent 6c8a158989
commit 23e483269d

View File

@ -500,8 +500,14 @@ static int get_audio_config(AVFormatContext *s)
if (basic_desc->mFormatID == kAudioFormatLinearPCM &&
ctx->audio_float &&
ctx->audio_bits_per_sample == 32 &&
ctx->audio_packed) {
stream->codec->codec_id = ctx->audio_be ? AV_CODEC_ID_PCM_F32BE : AV_CODEC_ID_PCM_F32LE;
} else if (basic_desc->mFormatID == kAudioFormatLinearPCM &&
ctx->audio_signed_integer &&
ctx->audio_bits_per_sample == 16 &&
ctx->audio_packed) {
stream->codec->codec_id = ctx->audio_be ? AV_CODEC_ID_PCM_S16BE : AV_CODEC_ID_PCM_S16LE;
} else {
av_log(s, AV_LOG_ERROR, "audio format is not supported\n");
return 1;