diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-02-25 18:53:19 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-02-25 18:53:19 +0000 |
commit | 613d610d74bc008482c3f5f71ba4d2917aee0884 (patch) | |
tree | 570ab9060c4add3852d4fe19969ddebbb59946fd | |
parent | bfffdd93823346b61978f9f7b4f20c4f5da7481b (diff) | |
download | xine-lib-613d610d74bc008482c3f5f71ba4d2917aee0884.tar.gz xine-lib-613d610d74bc008482c3f5f71ba4d2917aee0884.tar.bz2 |
When auto-detecting Xv ports, prefer port nos. >= configured.
(Transplanted from f03669a2395d97a3e40615db1089af084a69d299)
-rw-r--r-- | src/video_out/video_out_xcbxv.c | 21 | ||||
-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, 20 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index eb2058590..a9420261c 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1308,19 +1308,19 @@ 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 = xv_open_port (this, adaptor_it->data->base_id + j); - if (port) - return port; - } + { + xcb_xv_port_t port = adaptor_it->data->base_id + j; + if (port >= base && xv_open_port (this, port)) + return port; + } } return 0; } @@ -1390,11 +1390,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 886d30812..edb275eb2 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -1346,14 +1346,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; } @@ -1426,11 +1427,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 f3404b067..9c4dd478b 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -2222,14 +2222,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; } @@ -2450,11 +2451,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, |