[vlc-commits] XCB/XVideo: fix flawed logic for adaptor selection

Rémi Denis-Courmont git at videolan.org
Mon Dec 17 20:19:06 CET 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Dec 14 21:30:41 2012 +0200| [52157cf528851c7766b72222eac7ada382133110] | committer: Rémi Denis-Courmont

XCB/XVideo: fix flawed logic for adaptor selection

(cherry picked from commit 45ab9b93592068dfb8380f6c99b062b1b7c34574)

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

 modules/video_output/xcb/xvideo.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 3d99da8..17cb26c 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -413,7 +413,8 @@ static int Open (vlc_object_t *obj)
     if (adaptors == NULL)
         goto error;
 
-    int forced_adaptor = var_InheritInteger (obj, "xvideo-adaptor");
+    int adaptor_selected = var_InheritInteger (obj, "xvideo-adaptor");
+    int adaptor_current = -1;
 
     /* */
     video_format_t fmt;
@@ -427,12 +428,9 @@ static int Open (vlc_object_t *obj)
         const xcb_xv_adaptor_info_t *a = it.data;
         char *name;
 
-        if (forced_adaptor != -1 && forced_adaptor != 0)
-        {
-            forced_adaptor--;
+        adaptor_current++;
+        if (adaptor_selected != -1 && adaptor_selected != adaptor_current)
             continue;
-        }
-
         if (!(a->type & XCB_XV_TYPE_INPUT_MASK)
          || !(a->type & XCB_XV_TYPE_IMAGE_MASK))
             continue;



More information about the vlc-commits mailing list