Remove unreachable parsing code: for filters that use the option parser,
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 21 Nov 2009 19:50:33 +0000 (19:50 +0000)
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 21 Nov 2009 19:50:33 +0000 (19:50 +0000)
the args argument to open will always be NULL and vf->priv will always be
!= NULL.

git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@29945 b3059339-0415-0410-9bf9-f77b7e298cf2

libmpcodecs/vf_crop.c
libmpcodecs/vf_delogo.c
libmpcodecs/vf_eq.c
libmpcodecs/vf_format.c
libmpcodecs/vf_hue.c
libmpcodecs/vf_noformat.c
libmpcodecs/vf_scale.c

index 5916f61..0fc1ac3 100644 (file)
@@ -144,19 +144,6 @@ static int open(vf_instance_t *vf, char* args){
     vf->start_slice=start_slice;
     vf->draw_slice=draw_slice;
     vf->default_reqs=VFCAP_ACCEPT_STRIDE;
-    if(!vf->priv) {
-    vf->priv=malloc(sizeof(struct vf_priv_s));
-    // TODO: parse args ->
-    vf->priv->crop_x=
-    vf->priv->crop_y=
-    vf->priv->crop_w=
-    vf->priv->crop_h=-1;
-    } //if(!vf->priv)
-    if(args) sscanf(args, "%d:%d:%d:%d",
-    &vf->priv->crop_w,
-    &vf->priv->crop_h,
-    &vf->priv->crop_x,
-    &vf->priv->crop_y);
     mp_msg(MSGT_VFILTER, MSGL_INFO, "Crop: %d x %d, %d ; %d\n",
     vf->priv->crop_w,
     vf->priv->crop_h,
index 7654b62..c7252d2 100644 (file)
@@ -204,20 +204,6 @@ static int open(vf_instance_t *vf, char* args){
     vf->get_image=get_image;
     vf->query_format=query_format;
     vf->uninit=uninit;
-    if (!vf->priv)
-    {
-        vf->priv=malloc(sizeof(struct vf_priv_s));
-       memset(vf->priv, 0, sizeof(struct vf_priv_s));
-    }
-
-    if (args) res = sscanf(args, "%d:%d:%d:%d:%d",
-                          &vf->priv->xoff, &vf->priv->yoff,
-                          &vf->priv->lw, &vf->priv->lh,
-                          &vf->priv->band);
-    if (args && (res != 5)) {
-       uninit(vf);
-       return 0; // bad syntax
-    }
 
     mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n",
           vf->priv->xoff, vf->priv->yoff,
index e85deea..5e8c3b0 100644 (file)
@@ -208,12 +208,6 @@ static int open(vf_instance_t *vf, char* args)
        vf->put_image=put_image;
        vf->uninit=uninit;
 
-       if(!vf->priv) {
-       vf->priv = malloc(sizeof(struct vf_priv_s));
-       memset(vf->priv, 0, sizeof(struct vf_priv_s));
-       }
-       if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
-
        process = process_C;
 #if HAVE_MMX
        if(gCpuCaps.hasMMX) process = process_MMX;
index d97db98..52f66a6 100644 (file)
@@ -31,45 +31,6 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){
 static int open(vf_instance_t *vf, char* args){
     vf->query_format=query_format;
     vf->default_caps=0;
-    if(!vf->priv) {
-      vf->priv=malloc(sizeof(struct vf_priv_s));
-      vf->priv->fmt=IMGFMT_YUY2;
-    }
-    if(args){
-       if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
-       if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
-       if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else
-       if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
-       if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
-       if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
-       if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else
-       if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else
-       if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
-       if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
-       if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
-       if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
-       if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
-       if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
-       if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
-       if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else
-       if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else
-       if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else
-       if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
-       if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
-       if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
-       if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
-       if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
-       if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else
-       if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
-       if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
-       if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else
-       if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
-       if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
-       if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
-       { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
-    }
-
-
     return 1;
 }
 
index 89ed3ee..ec74c52 100644 (file)
@@ -152,11 +152,6 @@ static int open(vf_instance_t *vf, char* args)
        vf->put_image=put_image;
        vf->uninit=uninit;
 
-       if(!vf->priv) {
-       vf->priv = malloc(sizeof(struct vf_priv_s));
-       memset(vf->priv, 0, sizeof(struct vf_priv_s));
-       }
-       if (args) sscanf(args, "%f:%f", &vf->priv->hue, &vf->priv->saturation);
         vf->priv->hue *= M_PI / 180.0;
 
        process = process_C;
index 1938da1..2ca91c0 100644 (file)
@@ -31,45 +31,6 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){
 static int open(vf_instance_t *vf, char* args){
     vf->query_format=query_format;
     vf->default_caps=0;
-    if(!vf->priv) {
-      vf->priv=malloc(sizeof(struct vf_priv_s));
-      vf->priv->fmt=IMGFMT_YV12;
-    }
-    if(args){
-       if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
-       if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
-       if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else
-       if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
-       if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
-       if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
-       if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else
-       if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else
-       if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
-       if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
-       if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
-       if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
-       if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
-       if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
-       if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
-       if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else
-       if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else
-       if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else
-       if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
-       if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
-       if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
-       if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
-       if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
-       if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else
-       if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
-       if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
-       if(!strcasecmp(args,"rgba")) vf->priv->fmt=IMGFMT_RGBA; else
-       if(!strcasecmp(args,"argb")) vf->priv->fmt=IMGFMT_ARGB; else
-       if(!strcasecmp(args,"bgra")) vf->priv->fmt=IMGFMT_BGRA; else
-       if(!strcasecmp(args,"abgr")) vf->priv->fmt=IMGFMT_ABGR; else
-       { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args);return 0;}
-    }
-
-
     return 1;
 }
 
index d14b57a..a18b0eb 100644 (file)
@@ -508,25 +508,6 @@ static int open(vf_instance_t *vf, char* args){
     vf->query_format=query_format;
     vf->control= control;
     vf->uninit=uninit;
-    if(!vf->priv) {
-    vf->priv=malloc(sizeof(struct vf_priv_s));
-    // TODO: parse args ->
-    vf->priv->ctx=NULL;
-    vf->priv->ctx2=NULL;
-    vf->priv->w=
-    vf->priv->h=-1;
-    vf->priv->v_chr_drop=0;
-    vf->priv->accurate_rnd=0;
-    vf->priv->param[0]=
-    vf->priv->param[1]=SWS_PARAM_DEFAULT;
-    vf->priv->palette=NULL;
-    } // if(!vf->priv)
-    if(args) sscanf(args, "%d:%d:%d:%lf:%lf",
-    &vf->priv->w,
-    &vf->priv->h,
-    &vf->priv->v_chr_drop,
-    &vf->priv->param[0],
-    &vf->priv->param[1]);
     mp_msg(MSGT_VFILTER,MSGL_V,"SwScale params: %d x %d (-1=no scaling)\n",
     vf->priv->w,
     vf->priv->h);