From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 2333B4C906
	for <ffmpegdev@gitmailbox.com>; Thu, 10 Apr 2025 01:12:06 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5660968B7FD;
	Thu, 10 Apr 2025 04:12:02 +0300 (EEST)
Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net
 [217.70.183.200])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 61FE768B6AC
 for <ffmpeg-devel@ffmpeg.org>; Thu, 10 Apr 2025 04:11:55 +0300 (EEST)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 3827C4316C
 for <ffmpeg-devel@ffmpeg.org>; Thu, 10 Apr 2025 01:11:53 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc;
 s=gm1; t=1744247514;
 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=PkPG5FKXvFhzsaVLcEpKjdgnbF7sKYM8H0qXyQqH1bY=;
 b=j8g5kk4eesSxN09NglkO/FlauucZQ5uBT6hKkRhvf3cTeM+roh6HtwbJLVdBPnI4BgOnl0
 7zuzbz4YOmyJRvDLDBV1hh5l9MPL4nIjmIlaJlt33J2fzBD9PBR26fcRN0kBFnhD2ClJsB
 bnX0uK8FPmAqk3jEvnOFdo3YM/MlfyZ/kD/sMhW7YxE+ch8RBImNVHwsC8igwv128LWgRh
 kAA0ZLdSXwtEM8OP727QgyNODK7au5N52RO3WnhHFJrw4uK26iK7o6mVFQiMDrj73XVl4E
 rZABLsSBZJxeTersT4TYaZNFeHtKjGen9mvqcPyaSu2mtOts1PxARvFYOlZRuA==
Date: Thu, 10 Apr 2025 03:11:53 +0200
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Message-ID: <20250410011153.GB4991@pb2>
References: <20250404211451.91394-1-romain.beauxis@gmail.com>
 <20250404211451.91394-2-romain.beauxis@gmail.com>
MIME-Version: 1.0
In-Reply-To: <20250404211451.91394-2-romain.beauxis@gmail.com>
X-GND-State: clean
X-GND-Score: -70
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvtdejheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeeigeektdejudffjefhteegjedtgeettefggedthfejgfevhfetgeekjedtvdfhveenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg
X-GND-Sasl: michael@niedermayer.cc
Subject: Re: [FFmpeg-devel] [PATCH v11 1/8] libavcodec/decode.c: intercept
 `AV_PKT_DATA_METADATA_UPDATE` packet extra data,
 attach them to the next decoded frame with the same PTS.
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Content-Type: multipart/mixed; boundary="===============4065024597781622172=="
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250410011153.GB4991@pb2/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>


--===============4065024597781622172==
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="6D5ffWsQLK28NoLA"
Content-Disposition: inline


--6D5ffWsQLK28NoLA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Apr 04, 2025 at 04:14:44PM -0500, Romain Beauxis wrote:
> ---
>  libavcodec/decode.c | 130 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 130 insertions(+)
>=20
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index fca0c7ff58..39d054bdea 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
[...]
> @@ -702,6 +809,8 @@ int attribute_align_arg avcodec_send_packet(AVCodecCo=
ntext *avctx, const AVPacke
>  {
>      AVCodecInternal *avci =3D avctx->internal;
>      DecodeContext     *dc =3D decode_ctx(avci);
> +    const uint8_t *side_metadata;
> +    size_t size;
>      int ret;
> =20
>      if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
> @@ -719,6 +828,14 @@ int attribute_align_arg avcodec_send_packet(AVCodecC=
ontext *avctx, const AVPacke
>          ret =3D av_packet_ref(avci->buffer_pkt, avpkt);
>          if (ret < 0)
>              return ret;
> +
> +        side_metadata =3D av_packet_get_side_data(avpkt, AV_PKT_DATA_MET=
ADATA_UPDATE, &size);


> +        if (avpkt->pts !=3D AV_NOPTS_VALUE && side_metadata) {
> +            ret =3D insert_pending_metadata(&dc->pending_metadata, avpkt=
->pts,
> +                                          side_metadata, size);
> +            if (ret < 0)
> +                return ret;

Is the tree needed and a FIFO not enough ?


thx

[...]
--=20
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable

--6D5ffWsQLK28NoLA
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ/ca0gAKCRBhHseHBAsP
q6m6AKCPGCBRiVaxYd0p873btepkmhUPbgCdGdLpigR23ZHSG4NRqxXfN2bpCPw=
=fnPF
-----END PGP SIGNATURE-----

--6D5ffWsQLK28NoLA--

--===============4065024597781622172==
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".

--===============4065024597781622172==--