Fixed the abusive usage of GST_STATE_NULL to pause all cached sounds … #1
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.
…when a new sound play request is made.
According to this document:
https://gstreamer.freedesktop.org/documentation/plugin-development/basics/states.html
The GST_STATE_NULL should be used olny when no ressources is loaded/loaded.
The GST_STATE_PAUSED fits best to the requirement to have olny one sound
played at time.
Concerning the bug of the jumping sound volume, it has been fixed by replacing
the usage of GST_STATE_NULL by GST_STATE_PAUSED.
Concerning the whole usage of the GST library this commit is just a "hot fix"
I think the GST library should not be used the way it is now, in my opinion
as we want to have olny one sound playing a time we need a unique sound
stream/channel and a unique gstsoud buffer containing multiple sounds.
In this buffer we should keep track off the sounds addresses. By this way to
play a given sound we just have to seek in the sound buffer.