aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-19 15:52:32 +0100
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-04-12 13:33:54 -0400
commit61182d64347666f942c82e2574f9fc4c8cb45dea (patch)
tree0bc57ef750597be8481467dc141a6c7573f260e1
parente intel - fix number 2 (diff)
downloadenlightenment-61182d64347666f942c82e2574f9fc4c8cb45dea.tar.gz
mixer: try to fix a possible 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 f88273477..c6b8bfa50 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;