cleanup: changed if() to switch()
This commit is contained in:
parent
76c3e0f31c
commit
931a003f52
1 changed files with 19 additions and 15 deletions
|
|
@ -1832,21 +1832,21 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA
|
||||||
|
|
||||||
for( j = 0; j < 2; ++j )
|
for( j = 0; j < 2; ++j )
|
||||||
{
|
{
|
||||||
if( j == 0 )
|
switch(j){
|
||||||
{
|
case 0:
|
||||||
/* first, attempt to open the device using WAVEFORMATEXTENSIBLE,
|
/* first, attempt to open the device using WAVEFORMATEXTENSIBLE,
|
||||||
if this fails we fall back to WAVEFORMATEX */
|
if this fails we fall back to WAVEFORMATEX */
|
||||||
|
|
||||||
PaWin_InitializeWaveFormatExtensible( &waveFormat, devices[i].channelCount,
|
PaWin_InitializeWaveFormatExtensible( &waveFormat, devices[i].channelCount,
|
||||||
sampleFormat, waveFormatTag, sampleRate, channelMask );
|
sampleFormat, waveFormatTag, sampleRate, channelMask );
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 1:
|
||||||
else
|
|
||||||
{
|
|
||||||
/* retry with WAVEFORMATEX */
|
/* retry with WAVEFORMATEX */
|
||||||
|
|
||||||
PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount,
|
PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount,
|
||||||
sampleFormat, waveFormatTag, sampleRate );
|
sampleFormat, waveFormatTag, sampleRate );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* REVIEW: consider not firing an event for input when a full duplex
|
/* REVIEW: consider not firing an event for input when a full duplex
|
||||||
|
|
@ -3719,7 +3719,9 @@ static PaError ReadStream( PaStream* s,
|
||||||
{
|
{
|
||||||
/** @todo REVIEW: consider what to do if the input overflows.
|
/** @todo REVIEW: consider what to do if the input overflows.
|
||||||
do we requeue all of the buffers? should we be running
|
do we requeue all of the buffers? should we be running
|
||||||
a thread to make sure they are always queued? */
|
a thread to make sure they are always queued?
|
||||||
|
see: http://www.portaudio.com/trac/ticket/117
|
||||||
|
*/
|
||||||
|
|
||||||
result = paInputOverflowed;
|
result = paInputOverflowed;
|
||||||
}
|
}
|
||||||
|
|
@ -3824,7 +3826,9 @@ static PaError WriteStream( PaStream* s,
|
||||||
/** @todo REVIEW: consider what to do if the output
|
/** @todo REVIEW: consider what to do if the output
|
||||||
underflows. do we requeue all the existing buffers with
|
underflows. do we requeue all the existing buffers with
|
||||||
zeros? should we run a separate thread to keep the buffers
|
zeros? should we run a separate thread to keep the buffers
|
||||||
enqueued at all times? */
|
enqueued at all times?
|
||||||
|
see: http://www.portaudio.com/trac/ticket/117
|
||||||
|
*/
|
||||||
|
|
||||||
result = paOutputUnderflowed;
|
result = paOutputUnderflowed;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue