From: gineera Date: Sun, 19 Apr 2015 18:48:38 +0000 (+0000) Subject: Pa_process: Fix output channel adaption by not skipping the conversion when the host... X-Git-Tag: pa_stable_v190600_20161030~35 X-Git-Url: https://andrewgundersen.net/repos?a=commitdiff_plain;h=c0c0cb1414bb75efe90b0a0d4cc2f855afe9d3d3;p=portaudio Pa_process: Fix output channel adaption by not skipping the conversion when the host and user number-of-channels are not equal. Reported by Leif Asbrink when using an envy24 soundcard on Linux at it's native Int32 format with 1 or 2 channels. Corresponding fix for input already in r1913. --- diff --git a/src/common/pa_process.c b/src/common/pa_process.c index b1b5642..0faf841 100644 --- a/src/common/pa_process.c +++ b/src/common/pa_process.c @@ -744,7 +744,7 @@ static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, destChannelStrideBytes = bp->bytesPerUserInputSample; /* process host buffer directly, or use temp buffer if formats differ or host buffer non-interleaved, - * or if the number of channels differs between the host (set in stride) and the user */ + * or if num channels differs between the host (set in stride) and the user (eg with some Alsa hw:) */ if( bp->userInputSampleFormatIsEqualToHost && bp->hostInputIsInterleaved && bp->hostInputChannels[0][0].data && bp->inputChannelCount == hostInputChannels[0].stride ) { @@ -834,8 +834,10 @@ static unsigned long NonAdaptingProcess( PaUtilBufferProcessor *bp, { if( bp->userOutputIsInterleaved ) { - /* process host buffer directly, or use temp buffer if formats differ or host buffer non-interleaved */ - if( bp->userOutputSampleFormatIsEqualToHost && bp->hostOutputIsInterleaved ) + /* process host buffer directly, or use temp buffer if formats differ or host buffer non-interleaved, + * or if num channels differs between the host (set in stride) and the user (eg with some Alsa hw:) */ + if( bp->userOutputSampleFormatIsEqualToHost && bp->hostOutputIsInterleaved + && bp->outputChannelCount == hostOutputChannels[0].stride ) { userOutput = hostOutputChannels[0].data; skipOutputConvert = 1;