# HG changeset patch # User reimar # Date 1258833033 0 # Node ID 391e683541a7c5a75924dbc892665b3edcc5d41c # Parent 85aaba93adf13729f2e6bf411b60fc9b4beb2fbe Remove unreachable parsing code: for filters that use the option parser, the args argument to open will always be NULL and vf->priv will always be != NULL. diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_crop.c --- a/libmpcodecs/vf_crop.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_crop.c Sat Nov 21 19:50:33 2009 +0000 @@ -144,19 +144,6 @@ 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, diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_delogo.c --- a/libmpcodecs/vf_delogo.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_delogo.c Sat Nov 21 19:50:33 2009 +0000 @@ -204,20 +204,6 @@ 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, diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_eq.c --- a/libmpcodecs/vf_eq.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_eq.c Sat Nov 21 19:50:33 2009 +0000 @@ -208,12 +208,6 @@ 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; diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_format.c --- a/libmpcodecs/vf_format.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_format.c Sat Nov 21 19:50:33 2009 +0000 @@ -31,45 +31,6 @@ 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; } diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_hue.c --- a/libmpcodecs/vf_hue.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_hue.c Sat Nov 21 19:50:33 2009 +0000 @@ -152,11 +152,6 @@ 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; diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_noformat.c --- a/libmpcodecs/vf_noformat.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_noformat.c Sat Nov 21 19:50:33 2009 +0000 @@ -31,45 +31,6 @@ 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; } diff -r 85aaba93adf1 -r 391e683541a7 libmpcodecs/vf_scale.c --- a/libmpcodecs/vf_scale.c Sat Nov 21 18:59:52 2009 +0000 +++ b/libmpcodecs/vf_scale.c Sat Nov 21 19:50:33 2009 +0000 @@ -508,25 +508,6 @@ 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);