summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-09-06 13:40:00 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-09-06 13:40:00 +0000
commit88c924c520c3868b588a2ce78ce5d39b079ce13b (patch)
tree3442886b5e77eff67da34ae45d8dc79bb543b1d9 /libvo
parent6219ca26e0eb60788f1cc1a47b9a0f74f8167afe (diff)
downloadmpv-88c924c520c3868b588a2ce78ce5d39b079ce13b.tar.bz2
mpv-88c924c520c3868b588a2ce78ce5d39b079ce13b.tar.xz
add port parameter to -vo xv
based on patch from Jean-Yves Simon <lethalwp@tiscali.be> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10827 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_xv.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index f1b9c2a4f7..e4c2208385 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -593,14 +593,22 @@ static uint32_t preinit(const char *arg)
XvPortID xv_p;
int busy_ports=0;
+ xv_port = 0;
+
if(arg)
{
- mp_msg(MSGT_VO,MSGL_ERR,"vo_xv: Unknown subdevice: %s\n",arg);
- return ENOSYS;
+ if ((strlen(arg) >= 6) && !strncmp(arg, "port=", 5))
+ {
+ xv_port = atoi(arg+5);
+ }
+ else
+ {
+ mp_msg(MSGT_VO,MSGL_ERR,"vo_xv: Unknown subdevice: %s\n",arg);
+ return ENOSYS;
+ }
}
if (!vo_init()) return -1;
- xv_port = 0;
/* check for Xvideo extension */
if (Success != XvQueryExtension(mDisplay,&ver,&rel,&req,&ev,&err)){
mp_msg(MSGT_VO,MSGL_ERR,"Sorry, Xv not supported by this X11 version/driver\n");
@@ -610,11 +618,22 @@ static uint32_t preinit(const char *arg)
/* check for Xvideo support */
if (Success != XvQueryAdaptors(mDisplay,DefaultRootWindow(mDisplay), &adaptors,&ai)){
- mp_msg(MSGT_VO,MSGL_ERR,"Xv: XvQueryAdaptors failed");
+ mp_msg(MSGT_VO,MSGL_ERR,"Xv: XvQueryAdaptors failed\n");
return -1;
}
/* check adaptors */
+ if(xv_port >= adaptors)
+ {
+ 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;
+ }
+
for (i = 0; i < adaptors && xv_port == 0; 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)