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

CQTexperiment
Christopher Snowhill 2021-08-25 01:57:59 -07:00
parent 5b73336cb0
commit 6395684001
1 changed files with 7 additions and 2 deletions

View File

@ -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;