# HG changeset patch # User ben # Date 1210701145 0 # Node ID 41794a5fb100228141abf074356812c4dd150b76 # Parent 581d694db6a4918c8c8e74bc18cbbfe32a8136ff Add a new suboption to -vo xv and -vo xvmc that allows selection of XVideo adaptor to be used (instead of default one, which is #0). This is useful for example if you'd rather like to use the original Overlay renderer of your GPU instead of the texture blitting engine (which is usually default), which is number one cause of nasty video tearing effects. diff -r 581d694db6a4 -r 41794a5fb100 DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Tue May 13 17:30:18 2008 +0000 +++ b/DOCS/man/en/mplayer.1 Tue May 13 17:52:25 2008 +0000 @@ -3341,6 +3341,8 @@ beginning. .PD 0 .RSs +.IPs adaptor= +Select a specific XVideo adaptor (check xvinfo results). .IPs port= Select a specific XVideo port. .IPs ck= @@ -3389,6 +3391,8 @@ extension of XFree86 4.x to speed up MPEG-1/2 and VCR2 decoding. .PD 0 .RSs +.IPs adaptor= +Select a specific XVideo adaptor (check xvinfo results). .IPs port= Select a specific XVideo port. .IPs (no)benchmark diff -r 581d694db6a4 -r 41794a5fb100 DOCS/man/fr/mplayer.1 --- a/DOCS/man/fr/mplayer.1 Tue May 13 17:30:18 2008 +0000 +++ b/DOCS/man/fr/mplayer.1 Tue May 13 17:52:25 2008 +0000 @@ -3527,6 +3527,8 @@ puis regardez les lignes commençant par [xv common]. .PD 0 .RSs +.IPs adaptor= +Sélectionne un adaptateur XVideo particulier (cf. xvinfo). .IPs port= Sélectionne un port XVideo particulier. .IPs ck= @@ -3578,6 +3580,8 @@ XFree86 4.x pour accélérer les lectures de médias MPEG-1/\:2 et VCR2. .PD 0 .RSs +.IPs adaptor= +Sélectionne un adaptateur XVideo particulier (cf. xvinfo). .IPs port= Sélectionne un port XVideo particulier. .IPs (no)benchmark diff -r 581d694db6a4 -r 41794a5fb100 help/help_mp-en.h --- a/help/help_mp-en.h Tue May 13 17:30:18 2008 +0000 +++ b/help/help_mp-en.h Tue May 13 17:52:25 2008 +0000 @@ -1954,6 +1954,7 @@ "[VO_XV] DOCS/HTML/en/video.html#xv!\n"\ "[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.\n"\ "[VO_XV] Try -vo x11.\n" +#define MSGTR_LIBVO_XV_Adaptor "[VO_XV] Using Xv Adaptor #%d (%s)\n" // loader/ldt_keeper.c diff -r 581d694db6a4 -r 41794a5fb100 libvo/vo_xv.c --- a/libvo/vo_xv.c Tue May 13 17:30:18 2008 +0000 +++ b/libvo/vo_xv.c Tue May 13 17:52:25 2008 +0000 @@ -724,11 +724,13 @@ unsigned int i; strarg_t ck_src_arg = { 0, NULL }; strarg_t ck_method_arg = { 0, NULL }; + int xv_adaptor = -1; opt_t subopts[] = { /* name arg type arg var test */ { "port", OPT_ARG_INT, &xv_port, (opt_test_f)int_pos }, + { "adaptor", OPT_ARG_INT, &xv_adaptor, (opt_test_f)int_non_neg }, { "ck", OPT_ARG_STR, &ck_src_arg, xv_test_ck }, { "ck-method", OPT_ARG_STR, &ck_method_arg, xv_test_ckm }, { NULL } @@ -799,6 +801,10 @@ for (i = 0; i < adaptors && xv_port == 0; i++) { + /* check if adaptor number has been specified */ + if (xv_adaptor != -1 && xv_adaptor != i) + continue; + if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask)) { for (xv_p = ai[i].base_id; @@ -806,6 +812,8 @@ if (!XvGrabPort(mDisplay, xv_p, CurrentTime)) { xv_port = xv_p; + mp_msg(MSGT_VO, MSGL_INFO, + MSGTR_LIBVO_XV_Adaptor, i, ai[i].name); break; } else { diff -r 581d694db6a4 -r 41794a5fb100 libvo/vo_xvmc.c --- a/libvo/vo_xvmc.c Tue May 13 17:30:18 2008 +0000 +++ b/libvo/vo_xvmc.c Tue May 13 17:52:25 2008 +0000 @@ -57,6 +57,7 @@ static int first_frame;//draw colorkey on first frame static int use_queue; static int xv_port_request = 0; +static int xv_adaptor = -1; static int bob_deinterlace; static int top_field_first; @@ -282,6 +283,9 @@ printf("vo_xvmc: Querying %d adaptors\n",num_adaptors); } for(i=0; i