From 6395684001ccd6e9d67e39fdfd612b698ae5b8c4 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 25 Aug 2021 01:57:59 -0700 Subject: [PATCH] CoreAudio input: Fixed new case where lossy inputs report file bit depth as unsupported field, causing some or possibly all lossy files to fail to decode --- Plugins/CoreAudio/CoreAudioDecoder.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plugins/CoreAudio/CoreAudioDecoder.m b/Plugins/CoreAudio/CoreAudioDecoder.m index c3b78c977..ec9ab2f9d 100644 --- a/Plugins/CoreAudio/CoreAudioDecoder.m +++ b/Plugins/CoreAudio/CoreAudioDecoder.m @@ -164,8 +164,13 @@ static SInt64 getSizeProc(void* clientData) { size = sizeof(formatBitsPerSample); err = AudioFileGetProperty(afi, kAudioFilePropertySourceBitDepth, &size, &formatBitsPerSample); if(err != noErr) { - err = ExtAudioFileDispose(_in); - return NO; + if (err == kAudioFileUnsupportedPropertyError) { + formatBitsPerSample = 0; // floating point formats apparently don't return this any more + } + else { + err = ExtAudioFileDispose(_in); + return NO; + } } UInt32 _bitrate;