Skip to content

Commit 0ec65c7

Browse files
authored
Do not attempt to load non-existing default soundfonts (#1731)
1 parent 962b994 commit 0ec65c7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/fluidsynth.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,21 @@ int main(int argc, char **argv)
947947

948948
if((s != NULL) && (s[0] != '\0'))
949949
{
950-
fluid_synth_sfload(synth, s, 1);
950+
if(!fluid_file_test(s, FLUID_FILE_TEST_EXISTS))
951+
{
952+
if(verbose)
953+
{
954+
fprintf(stdout, "Default SoundFont file '%s' does not exist.\n", s);
955+
}
956+
}
957+
else
958+
{
959+
if(verbose)
960+
{
961+
fprintf(stdout, "No SoundFont specified, loading default SoundFont '%s'\n", s);
962+
}
963+
fluid_synth_sfload(synth, s, 1);
964+
}
951965
}
952966

953967
FLUID_FREE(s);

0 commit comments

Comments
 (0)