aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-12-09 23:53:32 -0800
committerChris Robinson <[email protected]>2010-12-09 23:53:32 -0800
commitd73694d3e61db2157f1934d6cc0add7ab34b8b03 (patch)
tree8147b73fbb8741b871f77f7fb64977a44f155171 /Alc
parent5d607f948459c67a94f88cf21e77f3e04ea7e052 (diff)
More improvements to the AudioIO backend
Diffstat (limited to 'Alc')
-rw-r--r--Alc/solaris.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Alc/solaris.c b/Alc/solaris.c
index 26554d74..18c73343 100644
--- a/Alc/solaris.c
+++ b/Alc/solaris.c
@@ -138,6 +138,13 @@ static ALCboolean solaris_reset_playback(ALCdevice *device)
AUDIO_INITINFO(&info);
+ info.play.sample_rate = device->Frequency;
+
+ if(device->FmtChans != DevFmtMono)
+ device->FmtChans = DevFmtStereo;
+ numChannels = ChannelsFromDevFmt(device->FmtChans);
+ info.play.channels = numChannels;
+
switch(device->FmtType)
{
case DevFmtByte:
@@ -158,10 +165,6 @@ static ALCboolean solaris_reset_playback(ALCdevice *device)
break;
}
- numChannels = ChannelsFromDevFmt(device->FmtChans);
- info.play.sample_rate = device->Frequency;
- info.play.channels = numChannels;
-
frameSize = numChannels * BytesFromDevFmt(device->FmtType);
info.play.buffer_size = device->UpdateSize*device->NumUpdates * frameSize;
@@ -220,6 +223,8 @@ static void solaris_stop_playback(ALCdevice *device)
data->thread = NULL;
data->killNow = 0;
+ if(ioctl(data->fd, AUDIO_DRAIN) < 0)
+ AL_PRINT("Error draining device: %s\n", strerror(errno));
free(data->mix_data);
data->mix_data = NULL;