aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-12-23 21:06:10 -0800
committerChris Robinson <[email protected]>2014-12-23 21:06:10 -0800
commit93b69583d39305ad1ae483fda625f04919acbb5b (patch)
tree2a28f71be8fedac291a62816a0cc67e65dd51ed3 /Alc
parent2f162f0fc34d480b7c50d2f47f58f2143ee7832a (diff)
Try the device-specified channel configuration first
This does basically no checking that the channel config is correct, but should be good enough for when non-stereo modes are requested.
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/jack.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/Alc/backends/jack.c b/Alc/backends/jack.c
index da386d6a..d5ce956c 100644
--- a/Alc/backends/jack.c
+++ b/Alc/backends/jack.c
@@ -383,8 +383,7 @@ static ALCboolean ALCjackPlayback_reset(ALCjackPlayback *self)
device->UpdateSize = jack_get_buffer_size(self->Client);
device->NumUpdates = 2;
- /* FIXME: Force stereo, 32-bit float output. */
- device->FmtChans = DevFmtStereo;
+ /* Force 32-bit float output. */
device->FmtType = DevFmtFloat;
numchans = ChannelsFromDevFmt(device->FmtChans);
@@ -396,8 +395,21 @@ static ALCboolean ALCjackPlayback_reset(ALCjackPlayback *self)
if(self->Port[i] == NULL)
{
ERR("Not enough JACK ports available for %s output\n", DevFmtChannelsString(device->FmtChans));
- return ALC_FALSE;
+ if(i == 0)
+ return ALC_FALSE;
+ break;
+ }
+ }
+ if(i == 1)
+ device->FmtChans = DevFmtMono;
+ else if(i < numchans)
+ {
+ for(--i;i >= 2;i--)
+ {
+ jack_port_unregister(self->Client, self->Port[i]);
+ self->Port[i] = NULL;
}
+ device->FmtChans = DevFmtStereo;
}
ll_ringbuffer_free(self->Ring);