[Mplayer-cvslog] CVS: main/libvo vo_zr.c,1.2,1.3

Alban Bedel CVS albeu at mplayer.dev.hu
Sat Jan 19 18:02:52 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv18208/libvo

Modified Files:
	vo_zr.c 
Log Message:
Added reverting support for -zr* options


Index: vo_zr.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_zr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vo_zr.c	18 Jan 2002 09:58:18 -0000	1.2
+++ vo_zr.c	19 Jan 2002 17:02:50 -0000	1.3
@@ -73,8 +73,11 @@
 #define MJPEG_SIZE	1024*256
 
 //should be command line options
-int norm = VIDEO_MODE_AUTO; 
-char *device = "/dev/video";
+int norm = VIDEO_MODE_AUTO;
+#ifndef VO_ZR_DEFAULT_DEVICE
+#define VO_ZR_DEFAULT_DEVICE "/dev/video"
+#endif
+char *device = NULL;
 
 
 #ifdef ZR_USES_LIBJPEG
@@ -207,12 +210,13 @@
 
 
 int zoran_getcap() {
-	vdes = open(device, O_RDWR);
+	char* dev = device ? device : VO_ZR_DEFAULT_DEVICE;
+	vdes = open(dev, O_RDWR);
 	/* before we can ask for the maximum resolution, we must set 
 	 * the correct tv norm */
 
 	if (ioctl(vdes, BUZIOC_G_PARAMS, &zp) < 0) {
-		mp_msg(MSGT_VO, MSGL_ERR, "device at %s is probably not a DC10(+)/buz/lml33\n", device);
+		mp_msg(MSGT_VO, MSGL_ERR, "device at %s is probably not a DC10(+)/buz/lml33\n", dev);
 		return 1;
 	}
 	
@@ -234,7 +238,7 @@
 	
 	if (vdes < 0) {
 		mp_msg(MSGT_VO, MSGL_ERR, "error opening %s\n", 
-				device);
+				dev);
 		return 1;
 	}
 
@@ -640,4 +644,25 @@
 		
     }
     return ERR_NOT_AN_OPTION;
+}
+
+void vo_zr_revertoption(config_t* opt,char* param) {
+
+  if (!strcasecmp(param, "zrdev")) {
+    if(device)
+      free(device);
+    device=NULL;
+  } else if (!strcasecmp(param, "zrfi"))
+    forceinter=0;
+  else if (!strcasecmp(param, "zrcrop"))
+    g.set = g.xoff = g.yoff = 0;
+  else if (!strcasecmp(param, "zrvdec"))
+    vdec = 1;
+  else if (!strcasecmp(param, "zrquality"))
+    quality = 70;
+  else if (!strcasecmp(param, "zrdct"))
+    jpegdct = JDCT_IFAST;
+  else if (!strcasecmp(param, "zrnorm"))
+    norm = VIDEO_MODE_AUTO;
+
 }




More information about the MPlayer-cvslog mailing list