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 EE75C49974 for ; Mon, 25 Mar 2024 12:37:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 97A9068D467; Mon, 25 Mar 2024 14:37:17 +0200 (EET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA87468D457 for ; Mon, 25 Mar 2024 14:37:11 +0200 (EET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e6f69e850bso3628252b3a.0 for ; Mon, 25 Mar 2024 05:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711370229; x=1711975029; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=MEBieOhShRVUO0mFIosTohcocfM630+2wmWY1IQTu00=; b=hoFsO2Kx+imLG1ReiFayrlAfSWfGQxe2nx4h1bzTsUwcpUZILImfnNPh5XUGidUSH0 DDdKyhOx56KjTH0c4NInviER3uoe4jAF4VQ5YLv2s2yKygPA5P4IUSjTNe/HlJGW6nkt 8BzJlclm3kV3VcFMwB6YbGRLTsZpFWRFwUewmn4nm/FERg9Df0gkBa0HaDhTPJ7l+Ep3 fdxWQMQulMFLkVYC36c+jsIUBu4wE7VT+8jtFrtlvsx5LlP52bduoI9zqAMVOcl/OqL9 WfPmmSjdzYJeexVSUaXBXoA32Jfjnpx878RaAj2XAsFYmpE4JGJzsL8xghpNDl/z6bly IA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711370229; x=1711975029; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MEBieOhShRVUO0mFIosTohcocfM630+2wmWY1IQTu00=; b=tYeWClxDg5c2ZrxTF4vkZ6ycQSkdJmw7rOVoSRnqfcq+wewe+hLvyEcLKw9UIXChSP tiKNCjN5CKpFAZc2NXfNmvy12UVoK1yoU11BkXu6q9pQYz3ydgXUL/Fkwb631J94C3Ah Z2vcpCx5I1oPuFvl6AWWBC9ezhXJs2cs5uqLmTx5aBn56l2ya3eX8SSJjWWDvThZbBAn SPRFXOhS/4DUaLmnVMgIoeMcWPBrFce+W+c/nxSGBkTjNVWGWnBgcUYQCScPpuFCtQsp lI9n2YX/fzL9Q3f2wl+39nyVmvAt7pk16WtRq+2Fla1Kx7Ef8S1ZP+CS0a5fiQnGbWOy 5t5g== X-Gm-Message-State: AOJu0YwssPdrsPlsIADRkFYtFTyE/oaUZbvW3Pl8571Z0zwB+0FI/eVe LZ0pWZYxim20l7xOD/07/S7uiw1vFfKPHfJukZycG9XgltOm5FR9jkcW2pUw X-Google-Smtp-Source: AGHT+IGTPeMTPIWfs2zMuRyQQp+cCkZFCcvEtFD3w729+LKuccbuJb0p8uhVS7PCe9BVhbmgtHykDQ== X-Received: by 2002:aa7:88ce:0:b0:6ea:acbe:5186 with SMTP id k14-20020aa788ce000000b006eaacbe5186mr2818641pff.18.1711370229144; Mon, 25 Mar 2024 05:37:09 -0700 (PDT) Received: from [192.168.0.15] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id fn18-20020a056a002fd200b006e4e93f4f17sm4010633pfb.117.2024.03.25.05.37.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Mar 2024 05:37:08 -0700 (PDT) Message-ID: <69098bfa-2fe4-4c98-8fed-cdf1291e1bde@gmail.com> Date: Mon, 25 Mar 2024 09:37:06 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: James Almer To: ffmpeg-devel@ffmpeg.org References: <20240322160127.1635-1-jamrial@gmail.com> Content-Language: en-US In-Reply-To: <20240322160127.1635-1-jamrial@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avutil/channel_layout: don't clear the opaque pointer on type conversion 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 3/22/2024 1:01 PM, James Almer wrote: > Otherwise it would not be lossless. > > Signed-off-by: James Almer > --- > libavutil/channel_layout.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c > index a83618bcc7..3054ee08a5 100644 > --- a/libavutil/channel_layout.c > +++ b/libavutil/channel_layout.c > @@ -902,9 +902,11 @@ int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrde > lossy = 1; > } > if (!lossy || allow_lossy) { > + void *opaque = channel_layout->opaque; > av_channel_layout_uninit(channel_layout); > channel_layout->order = AV_CHANNEL_ORDER_UNSPEC; > channel_layout->nb_channels = nb_channels; > + channel_layout->opaque = opaque; > return lossy; > } > return AVERROR(ENOSYS); > @@ -916,8 +918,10 @@ int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrde > return AVERROR(ENOSYS); > lossy = has_channel_names(channel_layout); > if (!lossy || allow_lossy) { > + void *opaque = channel_layout->opaque; > av_channel_layout_uninit(channel_layout); > av_channel_layout_from_mask(channel_layout, mask); > + channel_layout->opaque = opaque; > return lossy; > } > } > @@ -925,6 +929,7 @@ int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrde > case AV_CHANNEL_ORDER_CUSTOM: { > AVChannelLayout custom = { 0 }; > int ret = av_channel_layout_custom_init(&custom, channel_layout->nb_channels); > + void *opaque = channel_layout->opaque; > if (ret < 0) > return ret; > if (channel_layout->order != AV_CHANNEL_ORDER_UNSPEC) > @@ -932,6 +937,7 @@ int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrde > custom.u.map[i].id = av_channel_layout_channel_from_index(channel_layout, i); > av_channel_layout_uninit(channel_layout); > *channel_layout = custom; > + channel_layout->opaque = opaque; > return 0; > } > case AV_CHANNEL_ORDER_AMBISONIC: > @@ -946,10 +952,12 @@ int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrde > return AVERROR(ENOSYS); > lossy = has_channel_names(channel_layout); > if (!lossy || allow_lossy) { > + void *opaque = channel_layout->opaque; > av_channel_layout_uninit(channel_layout); > channel_layout->order = AV_CHANNEL_ORDER_AMBISONIC; > channel_layout->nb_channels = nb_channels; > channel_layout->u.mask = mask; > + channel_layout->opaque = opaque; > return lossy; > } > } Will apply. _______________________________________________ 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".