Commit 4dcbdc87 authored by gineera's avatar gineera

Alsa: Fix handling of poll descriptors in PaAlsaStream_WaitForFrames(). ...

Alsa: Fix handling of poll descriptors in PaAlsaStream_WaitForFrames().  Otherwise if capture signals before playback a duplex stream could poll the wrong descriptor, causing a loop (reported by Alexander Kartashov).

git-svn-id: https://subversion.assembla.com/svn/portaudio/portaudio/trunk@1897 0f58301d-fd10-0410-b4af-bbb618454e57
parent 2b06cb15
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment