From 739a77699a8ace283f4fbabbe59a01bec6ad0767 Mon Sep 17 00:00:00 2001 From: albeu Date: Sat, 19 Jan 2002 17:02:50 +0000 Subject: [PATCH] Added reverting support for -zr* options git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4260 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_zr.c | 35 ++++++++++++++++++++++++++++++----- 1 file 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; + +}