The fix-up for URLs for files that that begin with // no longer works since the
QUrl class determines that these modifications are invalid, resulting in an
empty string when converted. Instead of attempting to modify the QUrl, add a
utility function that makes the correction on the encoded byte array at time of
usage.
As reported in issue 6302, playing a stream that causes gstreamer to error at
start can cause a crash. The problem occurs when the MoodbarPipeline receives a
pad-added signal after it has handled an error callback. In the error callback,
the builder_ is freed. In the pad-added handler (NewPadCallback), this object
is accessed.
This change adds a running_ flag that is set when the pipeline is started and
cleared on an error, end of stream, or object destruction. We check this flag at
the beginning of NewPadCallback. For sanity sake, we also check the builder_
pointer before dereferencing. Note that checking the state of the pipeline
wasn't an option since the pipeline is in the process of changing states during
the pad-added callback and gst_element_get_state wants to block during a state
change.
This solution is not complete as there are still some syncronization issues.
With this specific situation, the error and new pad callbacks appear to always
occur on the same thread, but that's probably not true for all error conditions.
The object is also destroyed by a different thread, so it may be possible that a
callback can occur at the wrong time during or after the deletion of the object.
See https://github.com/clementine-player/Clementine/issues/6302
When switching playback from an item for which the moodbar is not
displayed (e.g. an internet stream), to an item for which it is
displayed (e.g. a local mp3 file), Clementine sometimes crashes.
This happens because the slider_opt->maximum and slider_opt->minimum
have the value 0 (their default value), and the difference is used as a
divisor. This gives a division by 0, and a SIGFPE.
This problem has been fixed in commit af42cce. However, when a9f9b0e
reverted 3f79fa5, a little to much was reverted and we lost what af42cce
did. This patch re-introduces the fix.
Fixes#5261
moodbar: Add comment
result item not the first item anymore) so we should call it only once at
the beginning.
And instead of sorting all items everytime, we just insert them at the correct
position.
When an async moodbar load completes, it checks to see if the song is still playing and should update the UI.
It however failed to check if the song was stopped, so it would load a moodbar when no song is playing.
It now checks the player state before emitting a change.
Fixes#4663
When tearing down the pipeline, there was a leak of a GstBus which holds a socketpair open.
Eventually the OS runs out of file descriptors and terminates Clementine.
- Rewrite gstspectrum (1.0) to use FFTW (2x faster) and emit raw magnitude
values (not log scaled).
- Rewrite the moodbar generation code to be somewhat understandable, and
do it in Clementine instead of gstreamer.
Previously, the slide wasn't displayed at the exact position where the user clicked, and the moodbar's width was equal to the slider's width, while it should have been as long as long the groove.
When determining the next state (for rendering the change), the slider widgets vertical SizePolicy is changed from Fixed to MinimumExpanding (same thing works the other way around).
This at least compiles against gstreamer 1.2.
Things that work:
* Playing audio
* Automatically completing tags
Things that don't work
* Spotify
* Moodbar
Things I haven't tested
* Transcoding