From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 12F224008F for ; Thu, 18 Dec 2025 06:43:04 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'NDp59Nkcs+to3uCR0EHecTjbnDmmET1+k769EBEiI2k=', expected b'aQwmESoZvGkomGHTABTX+xRzmIl9NJhNALmKFdxDebk=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1766040160; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=NDp59Nkcs+to3uCR0EHecTjbnDmmET1+k769EBEiI2k=; b=c0CZrnGgCCbYGKjEX3ugD/eMerEwoLKAqHf3IVhSlfC6+Na6fOBODwYM6+wxdk1wALJw2 BYkGL4hrImNcsxihcJx5yl20hTJzd6Bw3NNEvJ/HA6HY9pNizq3JUt/fbuI7ElD2wBP3+xQ 9QQMBVRLz2Lo9uat/qtdrXZti2bmTt3Av7mCJz0gvbxAOWRISWpWOxQRR+q8d0AozAje57a ysKB9YYSL4ek7SvnNLXeFC0ZjfOulDiKBjwWFhpb9ofLq9B5edsWSAyp38Gx39NWnjmLQTk 1ADytYuJd2rWK4iF+Kxs1smeILWcH+l2VQA9+cTuyKx49On/yQ2YRpNsarTQ== Received: from [172.20.0.2] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 58ECA69099A; Thu, 18 Dec 2025 08:42:40 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1766040149; b=G/x8gsiRTH3hZSD3CLoSiBTikToPRW8WcIeibiaWcs/y8rnnAdQ1QFV6uVyd0F8StANuf K5HQd+JWvBuV3fZ92JuYvlYtx6pjxkacjAG7WzTZ3qDgQlwT0+h3NW+PXYoo36cwfs1lAq8 7iZbNcJjDW3QomBxbBArqBxbqtzXg+khrCu+vgikuH4E7JaWDF+0Lewo/WR1QzUiL3Im9oe vy12nsJ9LSnOAkC5g9aa3vG7I9gLt5DbEtvsSEAiduSclVbf+uTEsT5Qj/msHfxttHUXlW5 OXXc74lwf+2EAADLDTbL3M381CK4Kkqlvt6CQCINFKu8pR5uAE5gY2dyeFSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1766040149; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=mdqgBe+uTOuMW8UB9EwdeUWrBmm5NvF5ijuvQ9F4ebc=; b=PReIIvqHbpvE7TJHmX8dCatN2P49BjPEhG5ZLIW+uoXQo/GvYb5apF12a1BRMgAcSJLL/ XjtRSFgwmKHpQrQdf2gvOYZdcd/Xh84nFIGSumvOEXm8zwqQUX7anMi6P7oBCidMz/br9gq osPlQN7Uxwvfgzr0MXv//ubWYlmESzhkIbLfCLksV2c53KoN2boJ0kHw8avR0FB9wQnwoTj Az7wcqIWWiMnwlbc3VffCH4zrMT/Uujru2QVKnRF3QSm5abSJZCfZYul4VBpNGdSg5XVcYu 96IB0Dc0qLIAx1rAEFcziC+sIWtTsUtgzJduhbQGoBJnYZldBdhNB5a/PTmQ== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1766040140; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=aQwmESoZvGkomGHTABTX+xRzmIl9NJhNALmKFdxDebk=; b=RDRO8zCgNBQg9wAtOlDd3RM5d1iQq+GHrOkrm/sOOA1NyloinSe8ZX8T+8118TfZkBtPF j+AUFkL8qEvd9zq+sKJslDJ/OJy+EZZt1xoiif6NdbWI4ZBWwH9XKsFIjOXnkUrEuIFIshu BCEWnIZJUT/Eu916SqTDq9ETMpuO0mZlmBv6hzwjjEGRJbIqSKKg1vv3HXLyqnGGhwk1+dn +WrPO7AZjSLAl+n9OBznxb4QtjLgomBfsuBvrktP3ZYsdFoeCeqX+Zd2vkiwwD1dMjjT+bQ 1B1HxyOaL65TuMVvG7Gyx2wYNwkxw6auNXJPL2P1rk0Skj7W/X/rb8wAJQmA== Received: from 55ca25703178 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id B0C66690950 for ; Thu, 18 Dec 2025 08:42:20 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Dec 2025 06:42:20 -0000 Message-ID: <176604014091.60.4889013895499978745@2cb04c0e5124> Message-ID-Hash: IIVSPJ263ELPLABWYF7J5YA5DIPB3L6U X-Message-ID-Hash: IIVSPJ263ELPLABWYF7J5YA5DIPB3L6U X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] libavcodec/libopusenc: fix type mismatch in OPUS_GET_LOOKAHEAD call (PR #21231) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: cenzhanquan1 via ffmpeg-devel Cc: cenzhanquan1 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21231 opened by cenzhanquan1 URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21231 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21231.patch Problem: Compilation fails when building with Opus library due to type mismatch in OPUS_GET_LOOKAHEAD macro call. The error is: "invalid operands to binary - (have 'int *' and 'opus_int32 *')" Root cause: - AVCodecContext.initial_padding is of type 'int', so &avctx->initial_padding is 'int*'; - Opus's OPUS_GET_LOOKAHEAD macro expands to __opus_check_int_ptr, which requires a 'opus_int32*' pointer for pointer subtraction; - Mismatched pointer types trigger compilation error in the macro's pointer arithmetic. Solution: Use an intermediate 'opus_int32' variable to adapt the type: 1. Declare opus_int32 lookahead and initialize with avctx->initial_padding; 2. Pass &lookahead to OPUS_GET_LOOKAHEAD (matches required 'opus_int32*' type); 3. Sync the result back to avctx->initial_padding to preserve original logic. This fix maintains full functionality while resolving the type mismatch, with no performance impact or behavior changes. Signed-off-by: cenzhanquan1 >>From daca8ca736f3b1266ebc23cda88a75a1ddd217ab Mon Sep 17 00:00:00 2001 From: cenzhanquan1 Date: Thu, 18 Dec 2025 14:38:48 +0800 Subject: [PATCH] libavcodec/libopusenc: fix type mismatch in OPUS_GET_LOOKAHEAD call Problem: Compilation fails when building with Opus library due to type mismatch in OPUS_GET_LOOKAHEAD macro call. The error is: "invalid operands to binary - (have 'int *' and 'opus_int32 *')" Root cause: - AVCodecContext.initial_padding is of type 'int', so &avctx->initial_padding is 'int*'; - Opus's OPUS_GET_LOOKAHEAD macro expands to __opus_check_int_ptr, which requires a 'opus_int32*' pointer for pointer subtraction; - Mismatched pointer types trigger compilation error in the macro's pointer arithmetic. Solution: Use an intermediate 'opus_int32' variable to adapt the type: 1. Declare opus_int32 lookahead and initialize with avctx->initial_padding; 2. Pass &lookahead to OPUS_GET_LOOKAHEAD (matches required 'opus_int32*' type); 3. Sync the result back to avctx->initial_padding to preserve original logic. This fix maintains full functionality while resolving the type mismatch, with no performance impact or behavior changes. Signed-off-by: cenzhanquan1 --- libavcodec/libopusenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 131886c8ea..543d4eba24 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -419,7 +419,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx) goto fail; } - ret = opus_multistream_encoder_ctl(enc, OPUS_GET_LOOKAHEAD(&avctx->initial_padding)); + ret = opus_multistream_encoder_ctl(enc, OPUS_GET_LOOKAHEAD((opus_int32*)&avctx->initial_padding)); if (ret != OPUS_OK) av_log(avctx, AV_LOG_WARNING, "Unable to get number of lookahead samples: %s\n", -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org