vaapidecodebin: fix a leaked display instance
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 2 Nov 2015 18:05:07 +0000 (19:05 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 9 Nov 2015 14:50:14 +0000 (15:50 +0100)
The display returned by gst_vaapi_video_context_get_display() increments the
references. Thus, we have to unref the returned display.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=757595

gst/vaapi/gstvaapidecodebin.c

index e602d62..4baec20 100644 (file)
@@ -314,6 +314,12 @@ gst_vaapi_decode_bin_handle_message (GstBin * bin, GstMessage * message)
   activate_vpp (vaapidecbin);
 
 bail:
+  if (display)
+    gst_vaapi_display_unref (display);
+
+  if (context)
+    gst_context_unref (context);
+
   GST_BIN_CLASS (gst_vaapi_decode_bin_parent_class)->handle_message (bin,
       message);
 }