mixer: Fix segfault when backend does not have any sink

This commit is contained in:
Marcel Hollerbach 2015-08-10 19:23:53 +02:00
parent 81e8a349bb
commit 5675ed26cd
1 changed files with 8 additions and 2 deletions

View File

@ -638,7 +638,10 @@ _sink_event(int type, void *info)
if (sink == mixer_context->sink_default)
{
l = emix_sinks_get();
mixer_context->sink_default = l->data;
if (l)
mixer_context->sink_default = l->data;
else
mixer_context->sink_default = NULL;
_mixer_gadget_update();
}
}
@ -669,7 +672,10 @@ _ready(void)
if (emix_sink_default_support())
mixer_context->sink_default = emix_sink_default_get();
else
mixer_context->sink_default = emix_sinks_get()->data;
{
if (emix_sinks_get())
mixer_context->sink_default = emix_sinks_get()->data;
}
_mixer_gadget_update();
}