[FFmpeg-devel] [PATCH] lavfi/vf_aspect: improve compatibility of parsing.
Michael Niedermayer
michaelni at gmx.at
Thu Apr 18 20:13:19 CEST 2013
On Thu, Apr 18, 2013 at 02:17:23PM +0200, Nicolas George wrote:
> Try to accept both the old "num:den" and the new "num/den"
> syntax. Fix "aspect=2" being ignored due to a missing den.
>
> Also remove a duplicated #include.
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
> libavfilter/vf_aspect.c | 29 +++++++++++++++++------------
> 1 file changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
> index 4c08e53..637f8d5 100644
> --- a/libavfilter/vf_aspect.c
> +++ b/libavfilter/vf_aspect.c
> @@ -26,7 +26,7 @@
> #include <float.h>
>
> #include "libavutil/common.h"
> -#include "libavutil/opt.h"
> +#include "libavutil/eval.h"
> #include "libavutil/mathematics.h"
> #include "libavutil/opt.h"
> #include "libavutil/parseutils.h"
> @@ -40,7 +40,7 @@ typedef struct {
> AVRational aspect;
> int max;
> #if FF_API_OLD_FILTER_OPTS
> - float aspect_num, aspect_den;
> + float aspect_den;
> #endif
> char *ratio_str;
> } AspectContext;
> @@ -51,10 +51,17 @@ static av_cold int init(AVFilterContext *ctx)
> int ret;
>
> #if FF_API_OLD_FILTER_OPTS
> - if (s->aspect_num > 0 && s->aspect_den > 0) {
> + if (s->ratio_str > 0 && s->aspect_den > 0) {
ratio_str is a char *, the > 0 looks wrong
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20130418/2465b66b/attachment.asc>
More information about the ffmpeg-devel
mailing list