diff options
author | Zhao Zhili <zhilizhao@tencent.com> | 2019-12-06 15:06:16 +0800 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2019-12-23 17:02:55 +0100 |
commit | 07ffdedf784e86b88074d8d3e08e55752869562a (patch) | |
tree | 03a85f3ffe04f881ebd0f70931a87194a70b08a7 /libavfilter | |
parent | 807e90d23265f736a1ae13bb94e5099607358662 (diff) | |
download | ffmpeg-07ffdedf784e86b88074d8d3e08e55752869562a.tar.gz |
avfilter/buffersink: replace init_opaque by init
The argument 'opaque' is always NULL since 0acf7e2 (2013),
and avfilter_init_filter() was removed in 52067b3c0e (2016).
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/buffersink.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 30153adbb2..5f2ed0e4b3 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -199,20 +199,6 @@ MAKE_AVFILTERLINK_ACCESSOR(int , sample_rate ) MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx ) -static av_cold int vsink_init(AVFilterContext *ctx, void *opaque) -{ - BufferSinkContext *buf = ctx->priv; - AVBufferSinkParams *params = opaque; - int ret; - - if (params) { - if ((ret = av_opt_set_int_list(buf, "pix_fmts", params->pixel_fmts, AV_PIX_FMT_NONE, 0)) < 0) - return ret; - } - - return common_init(ctx); -} - #define CHECK_LIST_SIZE(field) \ if (buf->field ## _size % sizeof(*buf->field)) { \ av_log(ctx, AV_LOG_ERROR, "Invalid size for " #field ": %d, " \ @@ -242,23 +228,6 @@ static int vsink_query_formats(AVFilterContext *ctx) return 0; } -static av_cold int asink_init(AVFilterContext *ctx, void *opaque) -{ - BufferSinkContext *buf = ctx->priv; - AVABufferSinkParams *params = opaque; - int ret; - - if (params) { - if ((ret = av_opt_set_int_list(buf, "sample_fmts", params->sample_fmts, AV_SAMPLE_FMT_NONE, 0)) < 0 || - (ret = av_opt_set_int_list(buf, "sample_rates", params->sample_rates, -1, 0)) < 0 || - (ret = av_opt_set_int_list(buf, "channel_layouts", params->channel_layouts, -1, 0)) < 0 || - (ret = av_opt_set_int_list(buf, "channel_counts", params->channel_counts, -1, 0)) < 0 || - (ret = av_opt_set_int(buf, "all_channel_counts", params->all_channel_counts, 0)) < 0) - return ret; - } - return common_init(ctx); -} - static int asink_query_formats(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; @@ -345,7 +314,7 @@ AVFilter ff_vsink_buffer = { .description = NULL_IF_CONFIG_SMALL("Buffer video frames, and make them available to the end of the filter graph."), .priv_size = sizeof(BufferSinkContext), .priv_class = &buffersink_class, - .init_opaque = vsink_init, + .init = common_init, .query_formats = vsink_query_formats, .activate = activate, .inputs = avfilter_vsink_buffer_inputs, @@ -365,7 +334,7 @@ AVFilter ff_asink_abuffer = { .description = NULL_IF_CONFIG_SMALL("Buffer audio frames, and make them available to the end of the filter graph."), .priv_class = &abuffersink_class, .priv_size = sizeof(BufferSinkContext), - .init_opaque = asink_init, + .init = common_init, .query_formats = asink_query_formats, .activate = activate, .inputs = avfilter_asink_abuffer_inputs, |