-
Notifications
You must be signed in to change notification settings - Fork 265
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
Race condition around fluid_player_get_total_ticks #648
Comments
You could call |
Let me be a bit more precise on the calling sequence:
So, to my understanding, the player can be in the playing state when no file has yet been loaded? |
Point 3 is redundant. Point 4 is not clear to me. "Synth is playing", how, when, where? Are you using fluidsynth's audio driver or are you rendering from the synth directly yourself?
Yes. But the answer to that question is not really enlightening, I think. The point is,
If you call |
I'm using one of the fluidsynth drivers, but I didn't know that the player could be in a playing state before it has actually loaded
I see, I didn't think this would be the case because the only parameter is the player (I basically assumed that if the status was FLUID_PLAYER_PLAYING then a file was surely loaded). I will be using |
FluidSynth version
2.1.2
Describe the bug
Calling
fluid_player_get_total_ticks
shortly afterfluid_player_add_mem
makes the function return 0 ticks. Sometimes the returned values can even be incorrect (lower than the actual maximum number of ticks).Expected behavior
fluid_player_get_total_ticks
returns the actual total number of ticks.Steps to reproduce
fluid_player_add_mem
fluid_player_get_total_ticks
Additional context
I'm implementing seek controls for a MIDI player and I figured querying
fluid_player_get_total_ticks
would be simpler than computing it from the file. It can take up to ~10 calls to get the function to return a meaningful value.Probably not relevant information but the synth is using a custom sfloader to load SF2 files from memory.
The text was updated successfully, but these errors were encountered: