From 607b7d94d09d7c64b90e9954453c7d2f3ad0f7a2 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 3 Feb 2021 21:11:03 -0500 Subject: [PATCH] OSS: support 32-bit signed format AFMT_S32_NE (#462) It may not be provided by all OSS implementations, so wrap the cases in `#ifdef AFMT_S32_NE`. --- src/hostapi/oss/pa_unix_oss.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hostapi/oss/pa_unix_oss.c b/src/hostapi/oss/pa_unix_oss.c index 80df4c3..b66b2c1 100644 --- a/src/hostapi/oss/pa_unix_oss.c +++ b/src/hostapi/oss/pa_unix_oss.c @@ -937,6 +937,11 @@ static PaError Pa2OssFormat( PaSampleFormat paFormat, int *ossFormat ) case paInt16: *ossFormat = AFMT_S16_NE; break; +#ifdef AFMT_S32_NE + case paInt32: + *ossFormat = AFMT_S32_NE; + break; +#endif default: return paInternalError; /* This shouldn't happen */ } @@ -960,6 +965,10 @@ static PaError GetAvailableFormats( PaOssStreamComponent *component, PaSampleFor frmts |= paInt8; if( mask & AFMT_S16_NE ) frmts |= paInt16; +#ifdef AFMT_S32_NE + if( mask & AFMT_S32_NE ) + frmts |= paInt32; +#endif if( frmts == 0 ) result = paSampleFormatNotSupported; -- 2.43.0