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 "
"GStreamer plugins (e.g. OGG and MP3)")
.arg(factoryName));
if (bin) gst_object_unref(GST_OBJECT(bin));
return nullptr;
}

View File

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