Break from the SNDCTL_DSP_CHANNELS loops on first error instead of

continuing with even higher channels numbers.
This commit is contained in:
Rein Klazes 2005-11-21 11:56:55 +00:00 committed by Alexandre Julliard
parent 7f5c0de965
commit 77a6d341c7
1 changed files with 3 additions and 0 deletions

View File

@ -788,6 +788,7 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev)
for (c = 1; c <= MAX_CHANNELS; c++) {
arg=c;
rc=ioctl(ossdev->fd, SNDCTL_DSP_CHANNELS, &arg);
if( rc == -1) break;
if (rc!=0 || arg!=c) {
TRACE("DSP_CHANNELS: rc=%d returned %d for %d\n",rc,arg,c);
continue;
@ -927,6 +928,7 @@ static BOOL OSS_WaveInInit(OSS_DEVICE* ossdev)
for (c = 1; c <= MAX_CHANNELS; c++) {
arg=c;
rc=ioctl(ossdev->fd, SNDCTL_DSP_CHANNELS, &arg);
if( rc == -1) break;
if (rc!=0 || arg!=c) {
TRACE("DSP_CHANNELS: rc=%d returned %d for %d\n",rc,arg,c);
continue;
@ -1019,6 +1021,7 @@ static void OSS_WaveFullDuplexInit(OSS_DEVICE* ossdev)
for (c = 1; c <= MAX_CHANNELS; c++) {
arg=c;
rc=ioctl(ossdev->fd, SNDCTL_DSP_CHANNELS, &arg);
if( rc == -1) break;
if (rc!=0 || arg!=c) {
TRACE("DSP_CHANNELS: rc=%d returned %d for %d\n",rc,arg,c);
continue;