discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=61182d64347666f942c82e2574f9fc4c8cb45dea

commit 61182d64347666f942c82e2574f9fc4c8cb45dea
Author: Marcel Hollerbach <marcel-hollerb...@t-online.de>
Date:   Sat Mar 19 15:52:32 2016 +0100

    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.
---
 src/modules/mixer/lib/backends/pulseaudio/pulse.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c 
b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
index f882734..c6b8bfa 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;

-- 


Reply via email to