Check first MIDI files then Soundfonts files in fluidsynth.c (#731)

This commit is contained in:
jjceresa 2020-12-31 10:28:12 +01:00 committed by GitHub
parent a14c70cbbd
commit 0ae16f6a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -842,6 +842,11 @@ int main(int argc, char **argv)
/* load the soundfonts (check that all non options are SoundFont or MIDI files) */
for(i = arg1; i < argc; i++)
{
if(fluid_is_midifile(argv[i]))
{
continue;
}
if(fluid_is_soundfont(argv[i]))
{
if(fluid_synth_sfload(synth, argv[i], 1) == -1)
@ -849,7 +854,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Failed to load the SoundFont %s\n", argv[i]);
}
}
else if(!fluid_is_midifile(argv[i]))
else
{
fprintf(stderr, "Parameter '%s' not a SoundFont or MIDI file or error occurred identifying it.\n", argv[i]);
}