From 3c700346913b2eb96f67debf2d056d90586fc577 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 8 Feb 2008 10:40:56 +0000 Subject: [PATCH] Properly store the current device settings for full duplex operation. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1432 423420c4-83ab-492f-b58f-81f9feb106b5 --- rdpsnd_sun.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rdpsnd_sun.c b/rdpsnd_sun.c index 1903ced..f8a4512 100644 --- a/rdpsnd_sun.c +++ b/rdpsnd_sun.c @@ -307,23 +307,21 @@ sun_set_format(RD_WAVEFORMATEX * pwfx) sun_pause(); if (pwfx->wBitsPerSample == 8) - { - info.play.encoding = AUDIO_ENCODING_LINEAR8; - } + format = AUDIO_ENCODING_LINEAR8; else if (pwfx->wBitsPerSample == 16) - { - info.play.encoding = AUDIO_ENCODING_LINEAR; - } + format = AUDIO_ENCODING_LINEAR; samplewidth = pwfx->wBitsPerSample / 8; if (pwfx->nChannels == 1) { info.play.channels = 1; + stereo = 0; } else if (pwfx->nChannels == 2) { info.play.channels = 2; + stereo = 1; samplewidth *= 2; } @@ -331,6 +329,7 @@ sun_set_format(RD_WAVEFORMATEX * pwfx) info.play.sample_rate = pwfx->nSamplesPerSec; info.play.precision = pwfx->wBitsPerSample; + info.play.encoding = format; info.play.samples = 0; info.play.eof = 0; info.play.error = 0;