channels/rdpsnd: fix rdpsnd_opensles_set_format() logic

If server says "PCM format" treat sound data as PCM, not ADPCM.
This fixes noise from speakers when using Xrdp as server.
This commit is contained in:
Zavadovsky Yan 2015-02-21 22:51:51 +03:00
parent b89ea3d902
commit 6ce87bd477

View File

@ -136,32 +136,7 @@ static void rdpsnd_opensles_set_format(rdpsndDevicePlugin* device,
opensles->rate = format->nSamplesPerSec;
opensles->channels = format->nChannels;
switch (format->wFormatTag)
{
case WAVE_FORMAT_PCM:
switch (format->wBitsPerSample)
{
case 4:
opensles->format = WAVE_FORMAT_ADPCM;
break;
case 8:
opensles->format = WAVE_FORMAT_PCM;
break;
case 16:
opensles->format = WAVE_FORMAT_ADPCM;
break;
}
break;
case WAVE_FORMAT_ADPCM:
case WAVE_FORMAT_DVI_ADPCM:
opensles->format = format->wFormatTag;
break;
}
opensles->format = format->wFormatTag;
opensles->wformat = format->wFormatTag;
opensles->block_size = format->nBlockAlign;
}