1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-18 12:32:09 +01:00

gstengine: Remove extra unref on element creation failure

GstEngine::CreateElement unrefs the supplied bin if an error
occurs. In all current cases, that bin is referenced by a
pipeline.
This commit is contained in:
Jim Broadus 2020-12-25 23:49:39 -08:00 committed by John Maguire
parent 5495445175
commit 616ccc6fde
2 changed files with 1 additions and 1 deletions

View File

@ -763,7 +763,6 @@ GstElement* GstEngine::CreateElement(const QString& factoryName,
"Please make sure that you have installed all necessary " "Please make sure that you have installed all necessary "
"GStreamer plugins (e.g. OGG and MP3)") "GStreamer plugins (e.g. OGG and MP3)")
.arg(factoryName)); .arg(factoryName));
if (bin) gst_object_unref(GST_OBJECT(bin));
return nullptr; return nullptr;
} }

View File

@ -267,6 +267,7 @@ bool GstEnginePipeline::Init() {
// Audio bin // Audio bin
audiobin_ = gst_bin_new("audiobin"); audiobin_ = gst_bin_new("audiobin");
// Floating reference is transferred to pipeline
gst_bin_add(GST_BIN(pipeline_), audiobin_); gst_bin_add(GST_BIN(pipeline_), audiobin_);
// Create the sink // Create the sink