Fix GstVaapiDisplay refcounting in vaapidecode.

This commit is contained in:
gb 2010-05-12 19:14:35 +00:00 committed by Gwenole Beauchesne
parent 91c4c2c6b5
commit 76661d73d1

View file

@ -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