[FFmpeg-devel] [PATCH] lavfi/scale: implement clever/insane heuristic parsing, and add a size option
Michael Niedermayer
michaelni at gmx.at
Mon Oct 29 14:04:08 CET 2012
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!
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121029/5f3c9795/attachment.asc>
More information about the ffmpeg-devel
mailing list