]> Repos - portaudio/commitdiff
Pa_process: Fix output channel adaption by not skipping the conversion when the host...
authorgineera <gineera@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 19 Apr 2015 18:48:38 +0000 (18:48 +0000)
committergineera <gineera@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 19 Apr 2015 18:48:38 +0000 (18:48 +0000)
src/common/pa_process.c

index b1b5642fb28fb62af21e9207e14fd7dc22942d48..0faf8414cfa4a7119959b85885fa9da7aa850b51 100644 (file)
@@ -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;