From patchwork Fri Dec 6 07:06:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 16614 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 F23B6444E3A for ; Fri, 6 Dec 2019 09:06:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E1AD968B5F5; Fri, 6 Dec 2019 09:06:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu2.qq.com (smtpbgeu2.qq.com [18.194.254.142]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9A64668B5D3 for ; Fri, 6 Dec 2019 09:06:31 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1575615987; bh=aqXvp/3QbFG3YA0ZmSBPSHTWZOdZMNVnyiUh0l5QQ7Y=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Ad+Y///FSOhI7E8ag19IyWZXkxoNta+gz0szvrhMPRl2uJT41LwwVU/AkZcWvrHya d0ftB3wpn/qwhij2EVmP4v5vyZxlvuax4jQrUx2bfzr/B9JpUxAvdWu9afsKEsQXea p/eppV3yBc+7zKBsr6UpB347buPZWC6/ZKF1+JYY= X-QQ-mid: esmtp2t1575615985tefugwubf Received: from ZHILIZHAO-MB1.tencent.com (unknown [14.17.22.53]) by esmtp4.qq.com (ESMTP) with id ; Fri, 06 Dec 2019 15:06:24 +0800 (CST) X-QQ-SSF: 01000000000000N0VG3006000000002 X-QQ-FEAT: EUGmOqWjSYLbiivZoxDQ99nVtngg4FtuUlVWNTKS/nrYAcV/2go8Db6u8MpDs 71lK36TWXK86kXSpatf0F3e5p8CbISe4BI8bYLmfTRDuVRzNuNaZTwu4gVDsV4BFTMZA7n8 QXIPHq9C/21/HMJ3tKruM8Ba9B59Tva+bbBpJChlsbrw7/92gseIcT9tfSqoZXxrn1NuKJF y0RmxQYj0En588y3DvFzA1X/BvPCaaUrN5981H5IOpzC0ApWg0KnwGANuuAgbTMFZgkUXt2 udKma71mWhm7g6ZDgLqSFL8IamayNNR4Kg9+1TYii6U+pH X-QQ-GoodBg: 0 From: quinkblack@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Dec 2019 15:06:16 +0800 Message-Id: <20191206070618.42407-2-quinkblack@foxmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191206070618.42407-1-quinkblack@foxmail.com> References: <20191206070618.42407-1-quinkblack@foxmail.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign11 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v2 2/4] 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,