summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_xv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/video_out_xv.c')
-rw-r--r--src/video_out/video_out_xv.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 115489e57..bc5928c25 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -1161,14 +1161,15 @@ xv_find_adaptor_by_port (int port, unsigned int adaptors,
static XvPortID xv_autodetect_port(xv_driver_t *this,
unsigned int adaptors,
XvAdaptorInfo *adaptor_info,
- unsigned int *adaptor_num) {
+ unsigned int *adaptor_num,
+ XvPortID base) {
unsigned int an, j;
for (an = 0; an < adaptors; an++)
if (adaptor_info[an].type & XvImageMask)
for (j = 0; j < adaptor_info[an].num_ports; j++) {
XvPortID port = adaptor_info[an].base_id + j;
- if (xv_open_port(this, port)) {
+ if (port >= base && xv_open_port(this, port)) {
*adaptor_num = an;
return port;
}
@@ -1241,11 +1242,12 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
xprintf(class->xine, XINE_VERBOSITY_NONE,
_("%s: could not open Xv port %d - autodetecting\n"),
LOG_MODULE, xv_port);
- xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num);
+ xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port);
} else
adaptor_num = xv_find_adaptor_by_port (xv_port, adaptors, adaptor_info);
- } else
- xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num);
+ }
+ if (!xv_port)
+ xv_port = xv_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0);
if (!xv_port) {
xprintf(class->xine, XINE_VERBOSITY_LOG,