restart the entire pulse connection when we get a disconnect and can't reconnect to refresh the socket location, also only send pulse ready when sinks have been fetched and the default sink is known

SVN revision: 76652
This commit is contained in:
Mike Blumenkrantz 2012-09-14 09:57:45 +00:00
parent d43a195c7d
commit c9c92d24e8
1 changed files with 9 additions and 3 deletions

View File

@ -103,10 +103,11 @@ _pulse_info_get(Pulse *d __UNUSED__, int type __UNUSED__, Pulse_Server_Info *ev)
if (ev->default_sink == pulse_sink_name_get(sink)) if (ev->default_sink == pulse_sink_name_get(sink))
{ {
default_sink = sink; default_sink = sink;
e_mod_mixer_pulse_update(); if (!_mixer_using_default) e_mod_mixer_pulse_update();
break; break;
} }
info = ev; info = ev;
if (_mixer_using_default) e_mod_mixer_pulse_ready(EINA_TRUE);
} }
static Eina_Bool static Eina_Bool
@ -153,7 +154,7 @@ _pulse_sinks_get(Pulse *p __UNUSED__, Pulse_Tag_Id id __UNUSED__, Eina_List *ev)
sinks = ev; sinks = ev;
pulse_sinks_watch(conn); pulse_sinks_watch(conn);
e_mod_mixer_pulse_ready(EINA_TRUE); if (default_sink) e_mod_mixer_pulse_ready(EINA_TRUE);
} }
static void static void
@ -226,7 +227,12 @@ _pulse_disconnected(Pulse *d, int type __UNUSED__, Pulse *ev)
} }
else else
{ {
pulse_connect(conn); if (!pulse_connect(conn))
{
e_mod_mixer_pulse_ready(EINA_FALSE);
e_mixer_pulse_shutdown();
e_mixer_pulse_init();
}
last_disc = ecore_time_unix_get(); last_disc = ecore_time_unix_get();
} }
return ECORE_CALLBACK_RENEW; return ECORE_CALLBACK_RENEW;