summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavdevice/avfoundation.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 1a7eb5b27e..8b7c5473a7 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -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;