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 536814B1C6 for ; Thu, 30 May 2024 18:04:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4029768D363; Thu, 30 May 2024 21:04:44 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 369C168ABD7 for ; Thu, 30 May 2024 21:04:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 88BE81BF203 for ; Thu, 30 May 2024 18:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717092276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DBHy7jkhy8qaTBrkrrbaOHh5PjBbigg8K5lKRgRHRn8=; b=EwAAILn5ar04KqHLEOWo7BUX5mJkys0IyInlI+1pxxULXv/N0ddaUKwRNNM50QoC7nXSdy MPlK1E/6jovsbnherVx2ADepnNNhR1l3XRPmIyGTr2RV6OU6evsVgsOPZ5gotXDnULIQbg hCFYlGc6hJUxGrK5YkCImNN+z/uyTAEPJU1vkCDvpeAQ3n/GYKwGvetmYmILnauqC4iJtR /9Oi5mAR3X/EuZQ1n+PjNEVLwXstrp2hCLUwSuRSjIuOSVFdiJjkn7y868Qd455pLhtGHB w90vv6WqsSYPEsDfx8r/szEC1ljAPBzQ4Wa2jnWqaRooRzrSmjnKkEiqVnRmxg== Date: Thu, 30 May 2024 20:04:35 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240530180435.GA2821752@pb2> References: <20240530174429.GZ2821752@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/nutdec: Don't create inconsistent side data 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: multipart/mixed; boundary="===============3912681393478298808==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============3912681393478298808== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="039oG8jMepJcyEBX" Content-Disposition: inline --039oG8jMepJcyEBX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2024 at 07:53:42PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > On Thu, May 30, 2024 at 02:14:20AM +0200, Andreas Rheinhardt wrote: > >> Forgotten in 65ddc74988245a01421a63c5cffa4d900c47117c. > >> > >> Signed-off-by: Andreas Rheinhardt > >> --- > >> libavformat/nutdec.c | 14 ++++---------- > >> 1 file changed, 4 insertions(+), 10 deletions(-) > >> > >> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c > >> index 0bb7f154db..34b7e3cb9a 100644 > >> --- a/libavformat/nutdec.c > >> +++ b/libavformat/nutdec.c > >> @@ -881,8 +881,6 @@ static int read_sm_data(AVFormatContext *s, AVIOCo= ntext *bc, AVPacket *pkt, int > >> int count =3D ffio_read_varlen(bc); > >> int skip_start =3D 0; > >> int skip_end =3D 0; > >> - int channels =3D 0; > >> - int64_t channel_layout =3D 0; > >> int sample_rate =3D 0; > >> int width =3D 0; > >> int height =3D 0; > >> @@ -930,7 +928,7 @@ static int read_sm_data(AVFormatContext *s, AVIOCo= ntext *bc, AVPacket *pkt, int > >> AV_WB64(dst, v64); > >> dst +=3D 8; > >> } else if (!strcmp(name, "ChannelLayout") && value_len = =3D=3D 8) { > >> - channel_layout =3D avio_rl64(bc); > >> + // Ignored > >> continue; > >> } else { > >> av_log(s, AV_LOG_WARNING, "Unknown data %s / %s\n", n= ame, type_str); > >> @@ -952,7 +950,7 @@ static int read_sm_data(AVFormatContext *s, AVIOCo= ntext *bc, AVPacket *pkt, int > >> } else if (!strcmp(name, "SkipEnd")) { > >> skip_end =3D value; > >> } else if (!strcmp(name, "Channels")) { > >> - channels =3D value; > >> + // Ignored > >> } else if (!strcmp(name, "SampleRate")) { > >> sample_rate =3D value; > >> } else if (!strcmp(name, "Width")) { > >> @@ -965,18 +963,14 @@ static int read_sm_data(AVFormatContext *s, AVIO= Context *bc, AVPacket *pkt, int > >> } > >> } > >> =20 > >> - if (channels || channel_layout || sample_rate || width || height)= { > >> - uint8_t *dst =3D av_packet_new_side_data(pkt, AV_PKT_DATA_PAR= AM_CHANGE, 28); > >> + if (sample_rate || width || height) { > >> + uint8_t *dst =3D av_packet_new_side_data(pkt, AV_PKT_DATA_PAR= AM_CHANGE, 16); > >> if (!dst) > >> return AVERROR(ENOMEM); > >> bytestream_put_le32(&dst, > >> AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE*(!!= sample_rate) + > >> AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS*(!!(= width|height)) > >> ); > >> - if (channels) > >> - bytestream_put_le32(&dst, channels); > >> - if (channel_layout) > >> - bytestream_put_le64(&dst, channel_layout); > >> if (sample_rate) > >> bytestream_put_le32(&dst, sample_rate); > >> if (width || height){ > >=20 > > This would break mid stream changes to the channel layout & channels wh= en it > > is carried at format level only > >=20 > > The commit message also does not adequately explain why such mid stream= changes > > are ignored > >=20 >=20 > Mid-stream changes like this have been deprecated in > 09b5d3fb44ae1036700f80c8c80b15e9074c58c3; > 65ddc74988245a01421a63c5cffa4d900c47117c removed it, but only > incompletely: The side data flags for channel count and channel layout > changes were no longer written (in fact, they were removed from > packet.h), yet it still wrote the rest of the side data as if these > flags existed and had been written. That is the inconsistency this > commit addresses. It does not address whether channel count/layout > updates should have been removed, because that has already happened. i honestly belive that we should support changing channel(layout) for cases like PCM in nut thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire --039oG8jMepJcyEBX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZli/sAAKCRBhHseHBAsP q2bRAJ958yiW4Z+0Ag7frFj4l80qYjB4LACfYE6NFBfAzwrdC/ha6uxeSX7D3oQ= =C8GG -----END PGP SIGNATURE----- --039oG8jMepJcyEBX-- --===============3912681393478298808== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============3912681393478298808==--