Restore GLX context only if there is one.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Fri, 26 Mar 2010 10:09:23 +0000 (10:09 +0000)
committergb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Fri, 26 Mar 2010 10:09:23 +0000 (10:09 +0000)
gst-libs/gst/vaapi/gstvaapiwindow_glx.c

index d448ff4..f99caf2 100644 (file)
@@ -276,7 +276,8 @@ gst_vaapi_window_glx_resize(GstVaapiWindow *window, guint width, guint height)
     GST_VAAPI_OBJECT_LOCK_DISPLAY(window);
     if (gl_make_current(dpy, GST_VAAPI_OBJECT_ID(window), priv->context, &cs)) {
         gl_resize(width, height);
-        gl_make_current(dpy, cs.window, cs.context, NULL);
+        if (cs.context)
+            gl_make_current(dpy, cs.window, cs.context, NULL);
     }
     GST_VAAPI_OBJECT_UNLOCK_DISPLAY(window);
     return TRUE;