emix: update sink of sink_input when changed

this fixes none changing sinks in the app.
This commit is contained in:
Marcel Hollerbach 2016-06-25 17:12:35 +02:00
parent afeb588632
commit 4f0e3bce84
1 changed files with 7 additions and 0 deletions

View File

@ -351,6 +351,7 @@ _sink_input_changed_cb(pa_context *c EINA_UNUSED,
void *userdata EINA_UNUSED)
{
Sink_Input *input = NULL, *i;
Sink *s = NULL;
Eina_List *l;
EINA_SAFETY_ON_NULL_RETURN(ctx);
@ -387,6 +388,12 @@ _sink_input_changed_cb(pa_context *c EINA_UNUSED,
input->base.volume = _pa_cvolume_convert(&info->volume);
input->base.mute = !!info->mute;
EINA_LIST_FOREACH(ctx->sinks, l, s)
{
if (s->idx == (int)info->sink)
input->base.sink = (Emix_Sink *)s;
}
if (ctx->cb)
ctx->cb((void *)ctx->userdata, EMIX_SINK_INPUT_CHANGED_EVENT,
(Emix_Sink_Input *)input);