summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-09-07 18:58:56 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-09-07 18:58:56 +0000
commitee6238154654ff04c9a0322a60e0ea588010b431 (patch)
tree56d52d4a0b7c0cc9fe534f9980e267f85327bde3 /libvo
parent39bdf999e9033544704a971f6f70075274d841a4 (diff)
downloadmpv-ee6238154654ff04c9a0322a60e0ea588010b431.tar.bz2
mpv-ee6238154654ff04c9a0322a60e0ea588010b431.tar.xz
hopefully final xv ports.
from Jim Hawkins <mplayer@jawkins.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10840 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_xv.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 7b7b68d80a..56f023d420 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -623,15 +623,26 @@ static uint32_t preinit(const char *arg)
}
/* check adaptors */
- if(xv_port >= ai[0].num_ports || xv_port < 0) // FIXME: ai[0] should not be hardcoded
- {
- mp_msg(MSGT_VO, MSGL_WARN,"Xv: Invalid port parameter, overriding with port 0\n");
- xv_port = 0;
- }
- if (xv_port)
- {
- if (XvGrabPort(mDisplay, xv_port, CurrentTime))
- xv_port = 0;
+ if (xv_port) {
+ int port_found;
+
+ for (port_found = 0, i = 0; !port_found && i < adaptors; i++) {
+ 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 (xv_p == xv_port) {
+ port_found = 1;
+ break;
+ }
+ }
+ }
+ }
+ if (port_found) {
+ if (XvGrabPort(mDisplay, xv_port, CurrentTime))
+ xv_port = 0;
+ } else {
+ mp_msg(MSGT_VO, MSGL_WARN,"Xv: Invalid port parameter, overriding with port 0\n");
+ xv_port = 0;
+ }
}
for (i = 0; i < adaptors && xv_port == 0; i++){