From: gb Date: Thu, 25 Mar 2010 12:39:54 +0000 (+0000) Subject: Simplify initialization of VADisplay. X-Git-Tag: 0.1.2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67de515e637b6d8df3601e46e3f4db2193c4aaa9;p=platform%2Fupstream%2Fgstreamer-vaapi.git Simplify initialization of VADisplay. --- diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 1ef23e4..0193681 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -280,8 +280,11 @@ gst_vaapi_display_create(GstVaapiDisplay *display) GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS(display); if (klass->open_display && !klass->open_display(display)) return FALSE; - if (klass->get_display) + if (klass->get_display) { priv->display = klass->get_display(display); + if (!priv->display) + return FALSE; + } if (klass->get_size) klass->get_size(display, &priv->width, &priv->height); if (klass->get_size_mm) diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c index a1e3479..30f7152 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_x11.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay_x11.c @@ -44,7 +44,6 @@ struct _GstVaapiDisplayX11Private { gchar *display_name; Display *x11_display; int x11_screen; - VADisplay *va_display; }; enum { @@ -149,8 +148,7 @@ gst_vaapi_display_x11_open_display(GstVaapiDisplay *display) return FALSE; priv->x11_screen = DefaultScreen(priv->x11_display); - priv->va_display = vaGetDisplay(priv->x11_display); - return priv->va_display != NULL; + return TRUE; } static void @@ -169,14 +167,12 @@ gst_vaapi_display_x11_close_display(GstVaapiDisplay *display) g_free(priv->display_name); priv->display_name = NULL; } - - priv->va_display = NULL; } static VADisplay gst_vaapi_display_x11_get_va_display(GstVaapiDisplay *display) { - return GST_VAAPI_DISPLAY_X11(display)->priv->va_display; + return vaGetDisplay(GST_VAAPI_DISPLAY_XDISPLAY(display)); } static void