From 8f9745a5a539e44244d5e8200c61ed443c638aad Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Sun, 19 Aug 2018 13:47:17 -0400 Subject: [PATCH] Prevent UI freeze when displaying song info window. Closes: #822. --- src/libaudcore/probe.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libaudcore/probe.cc b/src/libaudcore/probe.cc index 5c57ef884..38cf73d96 100644 --- a/src/libaudcore/probe.cc +++ b/src/libaudcore/probe.cc @@ -242,6 +242,15 @@ EXPORT bool aud_custom_infowin (const char * filename, PluginHandle * decoder) if (! strncmp (filename, "stdin://", 8)) return false; + // In hindsight, a flag should have been added indicating whether a + // plugin provides a custom info window or not. Currently, only two + // plugins do so. Since custom info windows are deprecated anyway, + // check for those two plugins explicitly and in all other cases, + // don't open the input file to prevent freezing the UI. + const char * base = aud_plugin_get_basename (decoder); + if (strcmp (base, "amidi-plug") && strcmp (base, "vtx")) + return false; + auto ip = (InputPlugin *) aud_plugin_get_header (decoder); if (! ip) return false;