]> Repos - portaudio/commitdiff
Alsa: Fix handling of poll descriptors in PaAlsaStream_WaitForFrames(). Otherwise...
authorgineera <gineera@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 13 Aug 2013 20:37:04 +0000 (20:37 +0000)
committergineera <gineera@0f58301d-fd10-0410-b4af-bbb618454e57>
Tue, 13 Aug 2013 20:37:04 +0000 (20:37 +0000)
src/hostapi/alsa/pa_linux_alsa.c

index 7783d01e81f346a58ea5d31de3472a3822bded25..acd01cd88ea99b9a941f39e60285a53b6806399e 100644 (file)
@@ -3770,7 +3770,8 @@ static PaError PaAlsaStream_WaitForFrames( PaAlsaStream *self, unsigned long *fr
         }
         if( pollPlayback )
         {
-            playbackPfds = self->pfds + (self->capture.pcm ? self->capture.nfds : 0);
+            /* self->pfds is in effect an array of fds; if necessary, index past the capture fds */
+            playbackPfds = self->pfds + (pollCapture ? self->capture.nfds : 0);
             PA_ENSURE( PaAlsaStreamComponent_BeginPolling( &self->playback, playbackPfds ) );
             totalFds += self->playback.nfds;
         }