From dd74e3ef339e89343cb3eefc8d9e91dcad8444f0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 25 Feb 2013 12:14:56 +0100 Subject: [PATCH 1/3] avfiltergraph: use sizeof(var) instead of sizeof(type) --- libavfilter/avfiltergraph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 7bbfc1ceb4..516617e62b 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -39,7 +39,7 @@ static const AVClass filtergraph_class = { AVFilterGraph *avfilter_graph_alloc(void) { - AVFilterGraph *ret = av_mallocz(sizeof(AVFilterGraph)); + AVFilterGraph *ret = av_mallocz(sizeof(*ret)); if (!ret) return NULL; ret->av_class = &filtergraph_class; @@ -61,7 +61,7 @@ void avfilter_graph_free(AVFilterGraph **graph) int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter) { AVFilterContext **filters = av_realloc(graph->filters, - sizeof(AVFilterContext*) * (graph->nb_filters + 1)); + sizeof(*filters) * (graph->nb_filters + 1)); if (!filters) return AVERROR(ENOMEM); From ef4d34aa7ee7bce9a63b308b640d56d053e5229a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 25 Feb 2013 23:01:11 +0100 Subject: [PATCH 2/3] filters.texi: restore mistakenly removed section name for noformat --- doc/filters.texi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index c7e2d9d184..9b39ea50ef 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -1314,6 +1314,8 @@ Negate input video. This filter accepts an integer in input, if non-zero it negates the alpha component (if available). The default value in input is 0. +@section noformat + Force libavfilter not to use any of the specified pixel formats for the input to the next filter. From 9676b9a2cdc4a90611188fc48d8d388e427997c5 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 12 Mar 2013 18:09:48 +0100 Subject: [PATCH 3/3] AVOption: remove an unused function parameter. --- libavutil/opt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 04f441338d..661a61bca5 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -349,7 +349,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) return 0; } -static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum, +static int get_number(void *obj, const char *name, double *num, int *den, int64_t *intnum, int search_flags) { void *dst, *target_obj; @@ -359,8 +359,6 @@ static int get_number(void *obj, const char *name, const AVOption **o_out, doubl dst = ((uint8_t*)target_obj) + o->offset; - if (o_out) *o_out= o; - return read_number(o, dst, num, den, intnum); error: @@ -374,7 +372,7 @@ int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_v double num = 1; int ret, den = 1; - if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0) + if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0) return ret; *out_val = num*intnum/den; return 0; @@ -386,7 +384,7 @@ int av_opt_get_double(void *obj, const char *name, int search_flags, double *out double num = 1; int ret, den = 1; - if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0) + if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0) return ret; *out_val = num*intnum/den; return 0; @@ -398,7 +396,7 @@ int av_opt_get_q(void *obj, const char *name, int search_flags, AVRational *out_ double num = 1; int ret, den = 1; - if ((ret = get_number(obj, name, NULL, &num, &den, &intnum, search_flags)) < 0) + if ((ret = get_number(obj, name, &num, &den, &intnum, search_flags)) < 0) return ret; if (num == 1.0 && (int)intnum == intnum)