13
0

AU scan: only update config when discovering new plugins

When reading cached info only, crash protection is not needed.
This commit is contained in:
Robin Gareus 2020-08-06 17:59:16 +02:00
parent 56934284e7
commit 357095b920
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -964,17 +964,21 @@ PluginManager::au_refresh (bool cache_only)
{ {
DEBUG_TRACE (DEBUG::PluginManager, "AU: refresh\n"); DEBUG_TRACE (DEBUG::PluginManager, "AU: refresh\n");
// disable automatic discovery in case we crash
bool discover_at_start = Config->get_discover_audio_units (); bool discover_at_start = Config->get_discover_audio_units ();
if (discover_at_start) {
/* disable automatic discovery in case scanning crashes */
Config->set_discover_audio_units (false); Config->set_discover_audio_units (false);
Config->save_state(); Config->save_state();
}
delete _au_plugin_info; delete _au_plugin_info;
_au_plugin_info = AUPluginInfo::discover(cache_only && !discover_at_start); _au_plugin_info = AUPluginInfo::discover(cache_only && !discover_at_start);
// successful scan re-enabled automatic discovery if it was set if (discover_at_start) {
/* successful scan re-enabled automatic discovery if it was set */
Config->set_discover_audio_units (discover_at_start); Config->set_discover_audio_units (discover_at_start);
Config->save_state(); Config->save_state();
}
for (PluginInfoList::iterator i = _au_plugin_info->begin(); i != _au_plugin_info->end(); ++i) { for (PluginInfoList::iterator i = _au_plugin_info->begin(); i != _au_plugin_info->end(); ++i) {
set_tags ((*i)->type, (*i)->unique_id, (*i)->category, (*i)->name, FromPlug); set_tags ((*i)->type, (*i)->unique_id, (*i)->category, (*i)->name, FromPlug);