summaryrefslogtreecommitdiffstats
path: root/libvo/vo_zr.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-19 17:02:50 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-19 17:02:50 +0000
commit739a77699a8ace283f4fbabbe59a01bec6ad0767 (patch)
tree751a2e5c925bda597e3077bbd9a7927500c20db3 /libvo/vo_zr.c
parentcc7095a22442787472159204923ba0f03be4b96c (diff)
downloadmpv-739a77699a8ace283f4fbabbe59a01bec6ad0767.tar.bz2
mpv-739a77699a8ace283f4fbabbe59a01bec6ad0767.tar.xz
Added reverting support for -zr* options
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4260 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_zr.c')
-rw-r--r--libvo/vo_zr.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/libvo/vo_zr.c b/libvo/vo_zr.c
index 33784e1f1f..71b40bbaca 100644
--- a/libvo/vo_zr.c
+++ b/libvo/vo_zr.c
@@ -73,8 +73,11 @@ struct video_capability vc;
#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 init_codec() {
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 @@ int zoran_getcap() {
if (vdes < 0) {
mp_msg(MSGT_VO, MSGL_ERR, "error opening %s\n",
- device);
+ dev);
return 1;
}
@@ -641,3 +645,24 @@ vo_zr_parseoption(struct config * conf, char *opt, char *param){
}
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;
+
+}