Only retrieve modification time once and remove warning if failed #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change removes the warning message if retrieving the soundfont file modification time fails in the sample cache loader. The warning made sense while we didn't have mtime support on all platforms, but after switching to GLibs g_stat, it's no longer needed.
To reduce the number of calls to fluid_get_file_modification_time and also get rid of a possible race condition, getting the mtime has been moved to fluid_samplecache_load.
This change also fixes #483 because it removes the bogus warning messages if a soundfont was loaded from memory by abusing the filename to store a pointer.
In #483 it was also discussed if we should bypass the sample caching completely for soundfonts that
were loaded from memory. After going through the code, I think this is not really sensible. The current
soundfont loader implementation always creates a copy of the data provided by the file callbacks, it also
takes care of uncompressing SF3 samples before storing them in the cache. So caching is quite benefitial, as it reduces the number of times the data gets copied and/or decompressed.