[vlc-devel] commit: XCB/XVideo: check version correctly ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Dec 12 13:45:55 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec 12 14:45:07 2009 +0200| [b656e58f91de591b2b3cab001833806448da534d] | committer: Rémi Denis-Courmont 

XCB/XVideo: check version correctly

X11 extensions are upward compatible only if they have the same major
version number. In other words, we wouldn't support XVideo >= 3.0.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b656e58f91de591b2b3cab001833806448da534d
---

 modules/video_output/xcb/xvideo.c |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index e8798d5..9edbbfe 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -108,22 +108,25 @@ static bool CheckXVideo (vout_display_t *vd, xcb_connection_t *conn)
     xcb_xv_query_extension_cookie_t ck = xcb_xv_query_extension (conn);
     bool ok = false;
 
+    /* We need XVideo 2.2 for PutImage */
     r = xcb_xv_query_extension_reply (conn, ck, NULL);
-    if (r != NULL)
-    {   /* We need XVideo 2.2 for PutImage */
-        if ((r->major > 2) || (r->major == 2 && r->minor >= 2))
-        {
-            msg_Dbg (vd, "using XVideo extension v%"PRIu8".%"PRIu8,
-                     r->major, r->minor);
-            ok = true;
-        }
-        else
-            msg_Dbg (vd, "XVideo extension too old (v%"PRIu8".%"PRIu8,
-                     r->major, r->minor);
-        free (r);
-    }
-    else
+    if (r == NULL)
         msg_Dbg (vd, "XVideo extension not available");
+    else
+    if (r->major != 2)
+        msg_Dbg (vd, "XVideo extension v%"PRIu8".%"PRIu8" unknown",
+                 r->major, r->minor);
+    else
+    if (r->minor < 2)
+        msg_Dbg (vd, "XVideo extension v%"PRIu8".%"PRIu8" too old",
+                 r->major, r->minor);
+    else
+    {
+        msg_Dbg (vd, "using XVideo extension v%"PRIu8".%"PRIu8,
+                 r->major, r->minor);
+        ok = true;
+    }
+    free (r);
     return ok;
 }
 




More information about the vlc-devel mailing list