From: Ed Maste Date: Tue, 19 Jan 2021 20:00:09 +0000 (-0500) Subject: OSS: correct test for unsupported formats X-Git-Tag: v19.7.0~61 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=fc2a24d3945ccf1a3905750b2ab59ce22f21cb1f;p=portaudio OSS: correct test for unsupported formats Previously GetAvailableFormats returned paSampleFormatNotSupported if AFMT_S16_NE was not supported, regardless of the supported state of any other formats. Instead, return paSampleFormatNotSupported if no supported formats are found. --- diff --git a/src/hostapi/oss/pa_unix_oss.c b/src/hostapi/oss/pa_unix_oss.c index 4ca3788..83ab558 100644 --- a/src/hostapi/oss/pa_unix_oss.c +++ b/src/hostapi/oss/pa_unix_oss.c @@ -961,7 +961,7 @@ static PaError GetAvailableFormats( PaOssStreamComponent *component, PaSampleFor frmts |= paInt8; if( mask & AFMT_S16_NE ) frmts |= paInt16; - else + if( frmts == 0 ) result = paSampleFormatNotSupported; *availableFormats = frmts;