changeset 1186:beb0ee0f3a25

Xv port locking patch by Artur Zaprzala <artur.zaprzala@talex.com.pl>
author arpi_esp
date Thu, 21 Jun 2001 22:36:02 +0000
parents e21c96e28062
children 9a8058213061
files libvo/vo_xv.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xv.c	Thu Jun 21 22:34:58 2001 +0000
+++ b/libvo/vo_xv.c	Thu Jun 21 22:36:02 2001 +0000
@@ -101,6 +101,7 @@
  XSizeHints hint;
  XVisualInfo vinfo;
  XEvent xev;
+ XvPortID xv_p;
 
  XGCValues xgcv;
  XSetWindowAttributes xswa;
@@ -177,9 +178,16 @@
      return -1;
     }
    /* check adaptors */
-   for (i = 0; i < adaptors; i++)
+   for (i = 0; i < adaptors && xv_port == 0; i++)
     {
-     if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask) && (xv_port == 0)) xv_port = ai[i].base_id;
+     if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask))
+	 for (xv_p = ai[i].base_id; xv_p < ai[i].base_id+ai[i].num_ports; ++xv_p)
+	     if (!XvGrabPort(mDisplay, xv_p, CurrentTime)) {
+		 xv_port = xv_p;
+		 break;
+	     } else {
+		 printf("Xv: could not grab port %i\n", (int)xv_p);
+	     }
     }
    /* check image formats */
    if (xv_port != 0)