Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only retrieve modification time once and remove warning if failed #485

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

mawe42
Copy link
Member

@mawe42 mawe42 commented Dec 15, 2018

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.

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.
@mawe42
Copy link
Member Author

mawe42 commented Dec 15, 2018

@realnc would you mind giving this a quick test using your setup?

@realnc
Copy link
Contributor

realnc commented Dec 15, 2018

Yep, this removes the warning on my end.

@derselbst derselbst merged commit 8da7f11 into master Dec 19, 2018
@derselbst derselbst deleted the remove-mtime-warning branch December 19, 2018 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bogus warning when loading soundfont from memory: Unable to read modificaton time of soundfont file
3 participants