summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-19 15:52:32 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-19 15:55:21 +0100
commit59937ab884156fc7c3e3c844035c8e5317f38487 (patch)
treec59c71a5514e3c9656a48deffcbd71063fbfb878
parentccd867e6ff64ecae2cd538f61a26e26d7d4e2959 (diff)
downloadenlightenment-devs/bu5hm4n/mixer_bug.tar.gz
mixer: try to fix a possible bugdevs/bu5hm4n/mixer_bug
for the case the default sink was removed the gadget will get a new default sink again, for the case of pa there is the possibility that at this time the sink is still the default one, but the sink gets removed. so we better set the default index to -1 and return just some sink for the case the default is deleted.
-rw-r--r--src/modules/mixer/lib/backends/pulseaudio/pulse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
index f882734779..c6b8bfa50b 100644
--- a/src/modules/mixer/lib/backends/pulseaudio/pulse.c
+++ b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
@@ -251,6 +251,9 @@ _sink_remove_cb(int index, void *data EINA_UNUSED)
Eina_List *l;
DBG("Removing sink: %d", index);
+ if (index == ctx->default_sink)
+ ctx->default_sink = -1;
+
EINA_LIST_FOREACH(ctx->sinks, l, sink)
{
if (sink->idx == index)
@@ -1019,7 +1022,7 @@ _sink_default_get(void)
EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
EINA_LIST_FOREACH(ctx->sinks, l, s)
- if (s->idx == ctx->default_sink)
+ if (s->idx == ctx->default_sink || ctx->default_sink == -1)
return (Emix_Sink *)s;
return NULL;