Commit 98d19ca8 authored by John Robinson's avatar John Robinson Committed by Carl Eugen Hoyos

lavd/avfoundation: Add support for 24 and 32bit integer input.

Tested on Mac Mini soundflower and built-in line input.

Reviewed-by: Thilo Borgmann
parent 23e48326
...@@ -508,6 +508,16 @@ static int get_audio_config(AVFormatContext *s) ...@@ -508,6 +508,16 @@ static int get_audio_config(AVFormatContext *s)
ctx->audio_bits_per_sample == 16 && ctx->audio_bits_per_sample == 16 &&
ctx->audio_packed) { ctx->audio_packed) {
stream->codec->codec_id = ctx->audio_be ? AV_CODEC_ID_PCM_S16BE : AV_CODEC_ID_PCM_S16LE; stream->codec->codec_id = ctx->audio_be ? AV_CODEC_ID_PCM_S16BE : AV_CODEC_ID_PCM_S16LE;
} else if (basic_desc->mFormatID == kAudioFormatLinearPCM &&
ctx->audio_signed_integer &&
ctx->audio_bits_per_sample == 24 &&
ctx->audio_packed) {
stream->codec->codec_id = ctx->audio_be ? AV_CODEC_ID_PCM_S24BE : AV_CODEC_ID_PCM_S24LE;
} else if (basic_desc->mFormatID == kAudioFormatLinearPCM &&
ctx->audio_signed_integer &&
ctx->audio_bits_per_sample == 32 &&
ctx->audio_packed) {
stream->codec->codec_id = ctx->audio_be ? AV_CODEC_ID_PCM_S32BE : AV_CODEC_ID_PCM_S32LE;
} else { } else {
av_log(s, AV_LOG_ERROR, "audio format is not supported\n"); av_log(s, AV_LOG_ERROR, "audio format is not supported\n");
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment