[FFmpeg-devel] [PATCH] lavfi/scale: implement clever/insane heuristic parsing, and add a size option

Stefano Sabatini stefasab at gmail.com
Mon Oct 29 17:48:43 CET 2012


On date Monday 2012-10-29 14:04:08 +0100, Michael Niedermayer encoded:
> On Mon, Oct 29, 2012 at 11:55:09AM +0100, Stefano Sabatini wrote:
> > If the first argument can be read as a video size, set that output size
> > in the scale. This allows to specify in a filtergraph:
> > scale=qcif or scale=320x240.
> > 
> > This is not completely safe, for example in case of a typo in the video
> > size string the first argument will be read as the input width
> > expression, giving rise to a confusing comment.
> > 
> > This patch must be applied on top of:
> > lavfi/scale: accept named option, make parsing more robust
> > 
> > TODO: update docs and bump micro
> > ---
> >  libavfilter/vf_scale.c |   44 ++++++++++++++++++++++++++++++++++++++++----
> >  1 files changed, 40 insertions(+), 4 deletions(-)
> 
> [...]
> > +    if (scale->size_str) {
> > +        char buf[32];
> > +        if ((ret = av_parse_video_size(&scale->w, &scale->h, scale->size_str)) < 0) {
> > +            av_log(ctx, AV_LOG_ERROR,
> > +                   "Invalid size '%s'\n", scale->size_str);
> > +            return ret;
> > +        }
> 
> fixing the error handling of av_parse_video_size() is needed before
> this
> 
> rest of the patch LGTM
> 
> Thanks!

Applied, thanks for the review.
-- 
FFmpeg = Fundamental & Fanciful Murdering Puristic EnGraver


More information about the ffmpeg-devel mailing list