From fc2a24d3945ccf1a3905750b2ab59ce22f21cb1f Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 19 Jan 2021 15:00:09 -0500 Subject: [PATCH] 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. --- src/hostapi/oss/pa_unix_oss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.43.0