aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-08-16 13:16:41 -0700
committerChris Robinson <[email protected]>2009-08-16 13:16:41 -0700
commit2d1191697ae5a770b7e0b57a612271ef70b6b890 (patch)
tree6aacbbbd280fbf4e34f131e2aea4e3e935d29ad3
parent0b5a0d1e7970fbaa310f8579d33379b481e78715 (diff)
Fix the Solaris backend
-rw-r--r--Alc/solaris.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/Alc/solaris.c b/Alc/solaris.c
index 66f41730..2ed8cc5e 100644
--- a/Alc/solaris.c
+++ b/Alc/solaris.c
@@ -129,6 +129,17 @@ static ALCboolean solaris_open_playback(ALCdevice *device, const ALCchar *device
info.play.precision = 8;
info.play.encoding = AUDIO_ENCODING_LINEAR8;
break;
+ case 4:
+ switch(numChannels)
+ {
+ case 1: device->Format = AL_FORMAT_MONO16; break;
+ case 2: device->Format = AL_FORMAT_STEREO16; break;
+ case 4: device->Format = AL_FORMAT_QUAD16; break;
+ case 6: device->Format = AL_FORMAT_51CHN16; break;
+ case 7: device->Format = AL_FORMAT_61CHN16; break;
+ case 8: device->Format = AL_FORMAT_71CHN16; break;
+ }
+ /* fall-through */
case 2:
info.play.precision = 16;
info.play.encoding = AUDIO_ENCODING_LINEAR;
@@ -138,7 +149,7 @@ static ALCboolean solaris_open_playback(ALCdevice *device, const ALCchar *device
}
frameSize = numChannels * aluBytesFromFormat(device->Format);
- info.play.buffer_size = device->UpdateSize * frameSize;
+ info.play.buffer_size = device->BufferSize * frameSize;
if(ioctl(data->fd, AUDIO_SETINFO, &info) < 0)
{
@@ -148,8 +159,6 @@ static ALCboolean solaris_open_playback(ALCdevice *device, const ALCchar *device
return ALC_FALSE;
}
- device->Frequency = info.play.sample_rate;
-
if(aluChannelsFromFormat(device->Format) != info.play.channels)
{
AL_PRINT("Could not set %d channels, got %d instead\n", aluChannelsFromFormat(device->Format), info.play.channels);
@@ -167,6 +176,7 @@ static ALCboolean solaris_open_playback(ALCdevice *device, const ALCchar *device
return ALC_FALSE;
}
+ device->Frequency = info.play.sample_rate;
device->UpdateSize = info.play.buffer_size / 4;
data->data_size = device->UpdateSize * frameSize;
@@ -198,6 +208,18 @@ static void solaris_close_playback(ALCdevice *device)
device->ExtraData = NULL;
}
+static ALCboolean solaris_start_context(ALCdevice *device, ALCcontext *context)
+{
+ device->Frequency = context->fFrequency;
+ return ALC_TRUE;
+}
+
+static void solaris_stop_context(ALCdevice *device, ALCcontext *context)
+{
+ (void)device;
+ (void)context;
+}
+
static ALCboolean solaris_open_capture(ALCdevice *device, const ALCchar *deviceName, ALCuint frequency, ALCenum format, ALCsizei SampleSize)
{
@@ -241,6 +263,8 @@ static ALCuint solaris_available_samples(ALCdevice *pDevice)
BackendFuncs solaris_funcs = {
solaris_open_playback,
solaris_close_playback,
+ solaris_start_context,
+ solaris_stop_context,
solaris_open_capture,
solaris_close_capture,
solaris_start_capture,