aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-12-23 22:02:56 -0800
committerChris Robinson <[email protected]>2014-12-23 22:02:56 -0800
commitad11a9072050784e0abf2bc1191ed3e0ae2d1d17 (patch)
treeac7ecd90b9320fc50a58e917549aca133dd576c4
parent93b69583d39305ad1ae483fda625f04919acbb5b (diff)
Don't update the channel format if all JACK ports were allocated
-rw-r--r--Alc/backends/jack.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/Alc/backends/jack.c b/Alc/backends/jack.c
index d5ce956c..639037bc 100644
--- a/Alc/backends/jack.c
+++ b/Alc/backends/jack.c
@@ -395,21 +395,23 @@ static ALCboolean ALCjackPlayback_reset(ALCjackPlayback *self)
if(self->Port[i] == NULL)
{
ERR("Not enough JACK ports available for %s output\n", DevFmtChannelsString(device->FmtChans));
- if(i == 0)
- return ALC_FALSE;
+ if(i == 0) return ALC_FALSE;
break;
}
}
- if(i == 1)
- device->FmtChans = DevFmtMono;
- else if(i < numchans)
+ if(i < numchans)
{
- for(--i;i >= 2;i--)
+ if(i == 1)
+ device->FmtChans = DevFmtMono;
+ else
{
- jack_port_unregister(self->Client, self->Port[i]);
- self->Port[i] = NULL;
+ for(--i;i >= 2;i--)
+ {
+ jack_port_unregister(self->Client, self->Port[i]);
+ self->Port[i] = NULL;
+ }
+ device->FmtChans = DevFmtStereo;
}
- device->FmtChans = DevFmtStereo;
}
ll_ringbuffer_free(self->Ring);