diff options
-rw-r--r-- | src/video_out/video_out_xcbxv.c | 17 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 12 | ||||
-rw-r--r-- | src/video_out/video_out_xxmc.c | 12 |
3 files changed, 25 insertions, 16 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 18d752431..b7001ca03 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1123,19 +1123,23 @@ xv_find_adaptor_by_port (int port, xcb_xv_adaptor_info_iterator_t *adaptor_it) } static xcb_xv_port_t xv_autodetect_port(xv_driver_t *this, - xcb_xv_adaptor_info_iterator_t *adaptor_it) + xcb_xv_adaptor_info_iterator_t *adaptor_it, + xcb_xv_port_t base) { for (; adaptor_it->rem; xcb_xv_adaptor_info_next(adaptor_it)) if (adaptor_it->data->type & XCB_XV_TYPE_IMAGE_MASK) { int j; for (j = 0; j < adaptor_it->data->num_ports; ++j) - if (!xv_check_yv12 (this->connection, adaptor_it->data->base_id + j)) + { + xcb_xv_port_t port = adaptor_it->data->base_id + j; + if (port >= base && !xv_check_yv12 (this->connection, port)) { - xcb_xv_port_t port = xv_open_port (this, adaptor_it->data->base_id + j); + xcb_xv_port_t port = xv_open_port (this, port); if (port) return port; } + } } return 0; } @@ -1205,11 +1209,12 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis 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, &adaptor_it); + xv_port = xv_autodetect_port (this, &adaptor_it, xv_port); } else xv_find_adaptor_by_port (xv_port, &adaptor_it); - } else - xv_port = xv_autodetect_port (this, &adaptor_it); + } + if (!xv_port) + xv_port = xv_autodetect_port (this, &adaptor_it, 0); if (!xv_port) { xprintf(class->xine, XINE_VERBOSITY_LOG, 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, diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 35346dd1d..1ef3652a9 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -2262,14 +2262,15 @@ xxmc_find_adaptor_by_port (int port, unsigned int adaptors, static XvPortID xxmc_autodetect_port(xxmc_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 (xxmc_open_port(this, port)) { + if (port >= base && xxmc_open_port(this, port)) { *adaptor_num = an; return port; } @@ -2486,11 +2487,12 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi xprintf(class->xine, XINE_VERBOSITY_NONE, _("%s: could not open Xv port %d - autodetecting\n"), LOG_MODULE, xv_port); - xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num); + xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, xv_port); } else adaptor_num = xxmc_find_adaptor_by_port (xv_port, adaptors, adaptor_info); - } else - xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num); + } + if (!xv_port) + xv_port = xxmc_autodetect_port(this, adaptors, adaptor_info, &adaptor_num, 0); if (!xv_port) { xprintf(class->xine, XINE_VERBOSITY_LOG, |