Commit Graph

10 Commits

Author SHA1 Message Date
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus 55edcf5321 Fix MoodbarPipeline crash on gstreamer error.
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
2019-03-17 22:26:01 -07:00
David Sansome 50551d987a Rewrite moodbar stuff for gstreamer-1.0:
- 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.
2014-09-21 19:38:13 +10:00
John Maguire bebd781fdf Reformat all non-3rd-party C/C++/Objective-C++.
Command line:
find src ext -regex '.*\.\(h\|cpp\|mm\)' -exec clang-format -i
 -style='{BasedOnStyle: Google, DerivePointerBinding: false}' {} \;
2014-02-07 16:34:20 +01:00
John Maguire 38f1b71761 Use url instead of filename. 2012-05-28 15:33:37 -07:00
John Maguire 823b59e3a7 Use uridecodebin for Moodbar. 2012-05-28 15:18:36 -07:00
David Sansome 4cfa474fb8 Stop listening for synchronous bus callbacks from the moodbar pipeline, fixes some weird event loop stalls 2012-05-27 21:33:17 +01:00
David Sansome d36dd4d753 Oops, actually load moodbar data on a different thread 2012-05-27 20:05:01 +01:00
David Sansome 19c3e1d5ec Add a Mood column to the playlist 2012-05-27 16:46:16 +01:00
David Sansome 51229b88c5 Create or load moodbar data for songs 2012-05-25 17:18:07 +01:00