aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);