Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-26 01:09:16 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-26 13:41:33 +0300
commit99feb59cf7ea9d6753502d76110ced96f128dac6 (patch)
treee0f823719df3fbb9db44e7c421bf84d894210320 /libavfilter/vf_telecine.c
parentaff855148a098c70c0a55c58aeb1205d839ed516 (diff)
avfilter/formats: Make ff_formats_pixdesc_filter return AVFilterFormats*
Up until now, it has returned the AVFilterFormats list via an AVFilterFormats** parameter; the actual return value was an int that was always AVERROR(ENOMEM) on error. The AVFilterFormats** argument was a pure output parameter which was only documented by naming the parameter rfmts. Yet nevertheless all callers initialized the underlying AVFilterFormats* to NULL. This commit changes this to return a pointer to AVFilterFormats directly. This is more in line with the API in general, as it allows to avoid checks for intermediate values. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_telecine.c')
-rw-r--r--libavfilter/vf_telecine.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index 99c6d22b7d..eaaddf734d 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -101,16 +101,11 @@ static av_cold int init(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)
{
- AVFilterFormats *formats = NULL;
- int ret;
-
- ret = ff_formats_pixdesc_filter(&formats, 0,
- AV_PIX_FMT_FLAG_BITSTREAM |
- AV_PIX_FMT_FLAG_PAL |
- AV_PIX_FMT_FLAG_HWACCEL);
- if (ret < 0)
- return ret;
- return ff_set_common_formats(ctx, formats);
+ int reject_flags = AV_PIX_FMT_FLAG_BITSTREAM |
+ AV_PIX_FMT_FLAG_HWACCEL |
+ AV_PIX_FMT_FLAG_PAL;
+
+ return ff_set_common_formats(ctx, ff_formats_pixdesc_filter(0, reject_flags));
}
static int config_input(AVFilterLink *inlink)