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,9 +164,14 @@ static SInt64 getSizeProc(void* clientData) {
size = sizeof(formatBitsPerSample); size = sizeof(formatBitsPerSample);
err = AudioFileGetProperty(afi, kAudioFilePropertySourceBitDepth, &size, &formatBitsPerSample); err = AudioFileGetProperty(afi, kAudioFilePropertySourceBitDepth, &size, &formatBitsPerSample);
if(err != noErr) { if(err != noErr) {
if (err == kAudioFileUnsupportedPropertyError) {
formatBitsPerSample = 0; // floating point formats apparently don't return this any more
}
else {
err = ExtAudioFileDispose(_in); err = ExtAudioFileDispose(_in);
return NO; return NO;
} }
}
UInt32 _bitrate; UInt32 _bitrate;
size = sizeof(_bitrate); size = sizeof(_bitrate);