Permalink
Browse files

Prevent UI freeze when displaying song info window. Closes: #822.

  • Loading branch information...
jlindgren90 committed Aug 19, 2018
1 parent ddfd82a commit 8f9745a5a539e44244d5e8200c61ed443c638aad
Showing with 9 additions and 0 deletions.
  1. +9 −0 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;

0 comments on commit 8f9745a

Please sign in to comment.