From 76661d73d1b16f8e9f09200d72b57a24a6541965 Mon Sep 17 00:00:00 2001 From: gb Date: Wed, 12 May 2010 19:14:35 +0000 Subject: [PATCH] Fix GstVaapiDisplay refcounting in vaapidecode. --- gst/vaapidecode/gstvaapidecode.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/vaapidecode/gstvaapidecode.c b/gst/vaapidecode/gstvaapidecode.c index 5d1f2be684..d20d8b57b9 100644 --- a/gst/vaapidecode/gstvaapidecode.c +++ b/gst/vaapidecode/gstvaapidecode.c @@ -162,10 +162,15 @@ error_commit_buffer: static inline gboolean gst_vaapidecode_ensure_display(GstVaapiDecode *decode) { - if (!decode->display) - decode->display = - gst_vaapi_display_lookup_downstream(GST_ELEMENT(decode)); - return decode->display != NULL; + GstVaapiDisplay *display; + + if (!decode->display) { + display = gst_vaapi_display_lookup_downstream(GST_ELEMENT(decode)); + if (!display) + return FALSE; + decode->display = g_object_ref(display); + } + return TRUE; } static gboolean