From 3a1d70d48c6f54b5e0f1be947b71b7ac2726c969 Mon Sep 17 00:00:00 2001 From: RSWilli Date: Wed, 28 May 2025 18:33:57 +0200 Subject: [PATCH] allow nullable target for ghost pads --- gst/gst_ghost_pad.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/gst_ghost_pad.go b/gst/gst_ghost_pad.go index dfe9d9b..57f241c 100644 --- a/gst/gst_ghost_pad.go +++ b/gst/gst_ghost_pad.go @@ -123,8 +123,14 @@ func (g *GhostPad) GetTarget() *Pad { // SetTarget sets the new target of the ghostpad gpad. Any existing target is unlinked and links to the new target are // established. if newtarget is nil the target will be cleared. func (g *GhostPad) SetTarget(target *Pad) bool { + var ctarget *C.GstPad + + if target != nil { + ctarget = target.Instance() + } + return gobool(C.gst_ghost_pad_set_target( - g.Instance(), target.Instance(), + g.Instance(), ctarget, )) }