From bc082ba56ca08ca1114a8cdeed27e9ecbe0cf84a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 25 May 2019 13:02:41 +0200 Subject: [PATCH] video: Don't unref video codec state in set_format() --- gstreamer-video/src/subclass/video_decoder.rs | 1 + gstreamer-video/src/subclass/video_encoder.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/gstreamer-video/src/subclass/video_decoder.rs b/gstreamer-video/src/subclass/video_decoder.rs index 057d2d464..95f8f53f6 100644 --- a/gstreamer-video/src/subclass/video_decoder.rs +++ b/gstreamer-video/src/subclass/video_decoder.rs @@ -515,6 +515,7 @@ where let instance = &*(ptr as *mut T::Instance); let imp = instance.get_impl(); let wrap: VideoDecoder = from_glib_borrow(ptr); + gst_video_sys::gst_video_codec_state_ref(state); let mut wrap_state = VideoCodecState::::new(state); gst_panic_to_error!(&wrap, &instance.panicked(), false, { diff --git a/gstreamer-video/src/subclass/video_encoder.rs b/gstreamer-video/src/subclass/video_encoder.rs index ff9165c9c..949232e79 100644 --- a/gstreamer-video/src/subclass/video_encoder.rs +++ b/gstreamer-video/src/subclass/video_encoder.rs @@ -469,6 +469,7 @@ where let instance = &*(ptr as *mut T::Instance); let imp = instance.get_impl(); let wrap: VideoEncoder = from_glib_borrow(ptr); + gst_video_sys::gst_video_codec_state_ref(state); let mut wrap_state = VideoCodecState::::new(state); gst_panic_to_error!(&wrap, &instance.panicked(), false, {