lavd/avfoundation: Add support for 16bit integer input.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 6 Mar 2015 00:06:57 +0000 (01:06 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 6 Mar 2015 00:06:57 +0000 (01:06 +0100)
Reviewed-by: Thilo Borgmann
libavdevice/avfoundation.m

index 1a7eb5b..8b7c547 100644 (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;