From patchwork Fri Dec 6 05:14:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 16610 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 372D344900B for ; Fri, 6 Dec 2019 07:15:12 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 168E468B5EE; Fri, 6 Dec 2019 07:15:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB26168B5EE for ; Fri, 6 Dec 2019 07:15:05 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1575609295; bh=aqXvp/3QbFG3YA0ZmSBPSHTWZOdZMNVnyiUh0l5QQ7Y=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=qAKFaZjsshfGGqoPWRLuXatDPdDLk4oA57xjMw+IHGua8XbDuchZ6y18pdva/XLvb TcjrDMU2DBIpLdMnrcsjjQzALaINajKMex4EWxNwec2Sgf5SJWs8u/nrz06HRExxrm x21rDBYnNr0ULXViGKBgRGZlDLpOCF+3dKmYFMX4= X-QQ-mid: esmtp7t1575609294ta4juu8uv Received: from ZHILIZHAO-MB1.tencent.com (unknown [14.17.22.53]) by esmtp4.qq.com (ESMTP) with id ; Fri, 06 Dec 2019 13:14:51 +0800 (CST) X-QQ-SSF: 01000000000000N0VG3006000000002 X-QQ-FEAT: EUGmOqWjSYJYDIDwCRZfQCwCGCUgcwSg0Rb4l0hXy7XGi7XPceyrWX+E9CegW V5D9sOYWfR534dBsjOuHIXsDXv25Q+K872984oOSd1Zvfu89njzlLf8Hi+mkRutHMPPWAoZ H79IYxaYzk6t8QMHHzzjP0Hv2EJ218owQ8VKAp2J136Y241/d5KjCx3ZKh70vWIkMhXKHOr JfaCsL8hPDhA3iscln+aJuRdpxQz3nOPRQJPc6j32o5aSvJ7qqxOa8IwcnArteKiRiA8fhc Ffs2Q9IqXeliRJrsdr9FzhWhDsVDRVtAQ2voT96GLmSp9f X-QQ-GoodBg: 0 From: quinkblack@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Dec 2019 13:14:46 +0800 Message-Id: <20191206051447.31830-2-quinkblack@foxmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191206051447.31830-1-quinkblack@foxmail.com> References: <20191206051447.31830-1-quinkblack@foxmail.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign12 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH 2/3] avfilter/buffersink: replace init_opaque by init X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Zhao Zhili The argument 'opaque' is always NULL since 0acf7e2 (2013). --- libavfilter/buffersink.c | 35 ++--------------------------------- 1 file 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,