From beaa22fabb22865287f8a5c9df6e73baa1aa8377 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 1 Sep 2020 09:50:12 +0200 Subject: [PATCH] base_transform: Reset unused vfuncs on consecutive configure calls If a user ends up changing the configured mode later on previously registered vfuncs are not reset meaning the object is effectively stuck in mode `Both`. --- gstreamer-base/src/subclass/base_transform.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gstreamer-base/src/subclass/base_transform.rs b/gstreamer-base/src/subclass/base_transform.rs index 62b58492f..2703ffc6d 100644 --- a/gstreamer-base/src/subclass/base_transform.rs +++ b/gstreamer-base/src/subclass/base_transform.rs @@ -874,10 +874,12 @@ pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static { match mode { BaseTransformMode::AlwaysInPlace => { + klass.transform = None; klass.transform_ip = Some(base_transform_transform_ip::); } BaseTransformMode::NeverInPlace => { klass.transform = Some(base_transform_transform::); + klass.transform_ip = None; } BaseTransformMode::Both => { klass.transform = Some(base_transform_transform::);