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
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.
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