gst free error only if occurs.

This commit is contained in:
Miroslav Šedivý 2021-01-14 14:15:17 +01:00
parent 0f27b81f76
commit c808759709

View File

@ -172,9 +172,9 @@ func CreatePipeline(pipelineStr string, clockRate float32) (*Pipeline, error) {
var gstError *C.GError
gstPipeline = C.gst_parse_launch(pipelineStrUnsafe, &gstError)
defer C.g_error_free(gstError)
if gstError != nil {
defer C.g_error_free(gstError)
return nil, fmt.Errorf("(pipeline error) %s", C.GoString(gstError.message))
}