]> Repos - portaudio/commitdiff
OSS: correct test for unsupported formats
authorEd Maste <emaste@FreeBSD.org>
Tue, 19 Jan 2021 20:00:09 +0000 (15:00 -0500)
committerPhil Burk <philburk@mobileer.com>
Thu, 21 Jan 2021 02:16:21 +0000 (18:16 -0800)
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

index 4ca378870b4a045ba9c4c3c115e9fb8403be6ff1..83ab558a44625523bb13d4501d46ac8dd7a1d725 100644 (file)
@@ -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;