[totem/wip/hadess/open-gl-error: 1/3] backend: Throw a better error if OpenGL couldn't init




commit 99e6ebd9d929b6105d351bd647bc7e3c429fb352
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 8 00:47:03 2022 +0200

    backend: Throw a better error if OpenGL couldn't init
    
    Throw a better error than "The specified file could not be found" when
    GTK fails to initialise OpenGL support.
    
    This can happen when the version of OpenGL supported by the drivers is
    too old to work with GTK, for example:
    MESA_GL_VERSION_OVERRIDE=2.7 totem
    
    Closes: #523

 src/backend/bacon-video-widget.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index f3ebfff5d..b11d9bee4 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -3344,6 +3344,14 @@ bvw_error_from_gst_error (BaconVideoWidget *bvw, GstMessage * err_msg)
    * BVW_ERROR_BROKEN_FILE
    */
 
+  if (src_typename &&
+      g_str_equal (src_typename, "GstGtkGLSink") &&
+      is_error (e, RESOURCE, NOT_FOUND)) {
+    ret = g_error_new_literal (BVW_ERROR, BVW_ERROR_GENERIC,
+                              _("Could not initialise OpenGL support"));
+    goto done;
+  }
+
   /* Can't open optical disc? */
   if (is_error (e, RESOURCE, NOT_FOUND) ||
       is_error (e, RESOURCE, OPEN_READ)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]