Unref pipeline in moodbar on failure
This commit is contained in:
@@ -93,6 +93,7 @@ void MoodbarPipeline::Start() {
|
|||||||
GstElement* fakesink = CreateElement("fakesink");
|
GstElement* fakesink = CreateElement("fakesink");
|
||||||
|
|
||||||
if (!decodebin || !convert_element_ || !spectrum || !fakesink) {
|
if (!decodebin || !convert_element_ || !spectrum || !fakesink) {
|
||||||
|
gst_object_unref(GST_OBJECT(pipeline_));
|
||||||
pipeline_ = nullptr;
|
pipeline_ = nullptr;
|
||||||
emit Finished(false);
|
emit Finished(false);
|
||||||
return;
|
return;
|
||||||
@@ -101,6 +102,7 @@ void MoodbarPipeline::Start() {
|
|||||||
// Join them together
|
// Join them together
|
||||||
if (!gst_element_link(convert_element_, spectrum) || !gst_element_link(spectrum, fakesink)) {
|
if (!gst_element_link(convert_element_, spectrum) || !gst_element_link(spectrum, fakesink)) {
|
||||||
qLog(Error) << "Failed to link elements";
|
qLog(Error) << "Failed to link elements";
|
||||||
|
gst_object_unref(GST_OBJECT(pipeline_));
|
||||||
pipeline_ = nullptr;
|
pipeline_ = nullptr;
|
||||||
emit Finished(false);
|
emit Finished(false);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user