Refactor format_supported with a nice switch() statement

This commit is contained in:
David PHAM-VAN 2016-01-29 09:58:48 -08:00
parent 8ef64aee96
commit 3f5ce2d43f
1 changed files with 11 additions and 20 deletions

View File

@ -214,26 +214,17 @@ static void rdpsnd_mac_free(rdpsndDevicePlugin* device)
static BOOL rdpsnd_mac_format_supported(rdpsndDevicePlugin* device, AUDIO_FORMAT* format)
{
if (format->wFormatTag == WAVE_FORMAT_PCM)
{
return TRUE;
}
else if (format->wFormatTag == WAVE_FORMAT_ALAW)
{
return TRUE;
}
else if (format->wFormatTag == WAVE_FORMAT_MULAW)
{
return TRUE;
}
else if (format->wFormatTag == WAVE_FORMAT_GSM610)
{
return FALSE;
}
else if (format->wFormatTag == WAVE_FORMAT_ADPCM || format->wFormatTag == WAVE_FORMAT_DVI_ADPCM)
{
return TRUE;
}
switch (format->wFormatTag)
{
case WAVE_FORMAT_PCM:
case WAVE_FORMAT_ALAW:
case WAVE_FORMAT_MULAW:
case WAVE_FORMAT_ADPCM:
case WAVE_FORMAT_DVI_ADPCM:
return TRUE;
case WAVE_FORMAT_GSM610:
return FALSE;
}
return FALSE;
}