va: decoder: Also ref the display when duplicating pictures.
authorHe Junyan <junyan.he@intel.com>
Fri, 19 Nov 2021 11:02:20 +0000 (19:02 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 19 Nov 2021 14:40:18 +0000 (14:40 +0000)
The _destroy_buffers() will check the display handle using the
g_return_val_if_fail. we should not generate the invalid pointer
warning.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1368>

subprojects/gst-plugins-bad/sys/va/gstvadecoder.c

index a88c3d2..973b4dc 100644 (file)
@@ -846,6 +846,7 @@ gst_va_decode_picture_dup (GstVaDecodePicture * pic)
 
   dup = g_slice_new0 (GstVaDecodePicture);
 
+  dup->display = gst_object_ref (pic->display);
   /* dups only need gstbuffer */
   dup->gstbuffer = gst_buffer_ref (pic->gstbuffer);
   return dup;