From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E461C45A16 for ; Fri, 10 Mar 2023 11:56:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8A95A68BE10; Fri, 10 Mar 2023 13:56:48 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E58BD68A9DF for ; Fri, 10 Mar 2023 13:56:41 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id AE3BC2405B5 for ; Fri, 10 Mar 2023 12:56:41 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id W_tE679bJ7pf for ; Fri, 10 Mar 2023 12:56:41 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 29101240178 for ; Fri, 10 Mar 2023 12:56:41 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D5F3B3A038E for ; Fri, 10 Mar 2023 12:56:40 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Mar 2023 12:56:30 +0100 Message-Id: <20230310115635.13639-1-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] lavc/decode: stop mangling last_pkt_props->opaque X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: It is currently abused to store packet size, which breaks AV_CODEC_FLAG_COPY_OPAQUE. Use stream_index instead, which is unused in libavcodec and has the same type as size. --- libavcodec/decode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index be2be81089..d1ba7f167f 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -140,7 +140,7 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt) if (pkt) { ret = av_packet_copy_props(avci->last_pkt_props, pkt); if (!ret) - avci->last_pkt_props->opaque = (void *)(intptr_t)pkt->size; // Needed for ff_decode_frame_props(). + avci->last_pkt_props->stream_index = pkt->size; // Needed for ff_decode_frame_props(). } return ret; } @@ -461,7 +461,7 @@ FF_ENABLE_DEPRECATION_WARNINGS pkt->dts = AV_NOPTS_VALUE; if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { // See extract_packet_props() comment. - avci->last_pkt_props->opaque = (void *)((intptr_t)avci->last_pkt_props->opaque - consumed); + avci->last_pkt_props->stream_index = avci->last_pkt_props->stream_index - consumed; avci->last_pkt_props->pts = AV_NOPTS_VALUE; avci->last_pkt_props->dts = AV_NOPTS_VALUE; } @@ -1355,7 +1355,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) int ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); if (ret < 0) return ret; - frame->pkt_size = (int)(intptr_t)pkt->opaque; + frame->pkt_size = pkt->stream_index; } #if FF_API_REORDERED_OPAQUE FF_DISABLE_DEPRECATION_WARNINGS -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".