Improve fetch of jack config
* Don't try to fetch jack config on new studio creation - it should be fetched on start, after user has configured JACK * Clear old jack configuration before fetching new one.
This commit is contained in:
parent
edd885329f
commit
2c4d943438
|
@ -435,10 +435,27 @@ conf_callback(
|
|||
|
||||
#undef context_ptr
|
||||
|
||||
static void jack_conf_clear(void)
|
||||
{
|
||||
struct list_head * node_ptr;
|
||||
|
||||
INIT_LIST_HEAD(&g_studio.jack_params); /* we will destroy the leaves as part of tree destroy traversal */
|
||||
while (!list_empty(&g_studio.jack_conf))
|
||||
{
|
||||
node_ptr = g_studio.jack_conf.next;
|
||||
list_del(node_ptr);
|
||||
jack_conf_container_destroy(list_entry(node_ptr, struct jack_conf_container, siblings));
|
||||
}
|
||||
|
||||
g_studio.jack_conf_valid = false;
|
||||
}
|
||||
|
||||
bool studio_fetch_jack_settings()
|
||||
{
|
||||
struct conf_callback_context context;
|
||||
|
||||
jack_conf_clear();
|
||||
|
||||
context.address[0] = 0;
|
||||
context.container_ptr = &g_studio.jack_conf;
|
||||
context.parent_ptr = NULL;
|
||||
|
@ -558,21 +575,11 @@ static bool studio_stop(void)
|
|||
void
|
||||
studio_clear(void)
|
||||
{
|
||||
struct list_head * node_ptr;
|
||||
|
||||
g_studio.modified = false;
|
||||
g_studio.persisted = false;
|
||||
g_studio.automatic = false;
|
||||
|
||||
INIT_LIST_HEAD(&g_studio.jack_params); /* we will destroy the leaves as part of tree destroy traversal */
|
||||
while (!list_empty(&g_studio.jack_conf))
|
||||
{
|
||||
node_ptr = g_studio.jack_conf.next;
|
||||
list_del(node_ptr);
|
||||
jack_conf_container_destroy(list_entry(node_ptr, struct jack_conf_container, siblings));
|
||||
}
|
||||
|
||||
g_studio.jack_conf_valid = false;
|
||||
jack_conf_clear();
|
||||
|
||||
studio_stop();
|
||||
|
||||
|
@ -1688,13 +1695,6 @@ bool studio_new(void * call_ptr, const char * studio_name)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!studio_fetch_jack_settings(g_studio))
|
||||
{
|
||||
lash_dbus_error(call_ptr, LASH_DBUS_ERROR_GENERIC, "studio_fetch_jack_settings() failed.");
|
||||
studio_clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue