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 21D4D45CDD for ; Fri, 2 Jun 2023 20:13:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 450CC68C361; Fri, 2 Jun 2023 23:13:40 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5070A68C332 for ; Fri, 2 Jun 2023 23:13:34 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id 8C74460005 for ; Fri, 2 Jun 2023 20:13:33 +0000 (UTC) Date: Fri, 2 Jun 2023 22:13:31 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230602201331.GX1391451@pb2> References: <20230601222601.12631-1-michael@niedermayer.cc> <20230601222601.12631-2-michael@niedermayer.cc> <467d8078-3b3a-4e10-a07e-e4f2cd1edd60@gmail.com> MIME-Version: 1.0 In-Reply-To: <467d8078-3b3a-4e10-a07e-e4f2cd1edd60@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/cbs_av1: Clear obu.metadata on error 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="===============5030067953227409019==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5030067953227409019== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4MRJAMMELAbUsYLE" Content-Disposition: inline --4MRJAMMELAbUsYLE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 01, 2023 at 09:33:14PM -0300, James Almer wrote: > On 6/1/2023 9:28 PM, Andreas Rheinhardt wrote: > > 1. Before 97f4263, the current_obu was reset (and the packet effectively > > discarded) upon errors from ff_cbs_read_packet(); yet this is no longer > > true and it seems that the contents of current_obu will be processed in > > the next call to av1_receive_frame(). This change seems to have been > > unintentional. >=20 > I guess I assumed that ff_cbs_read_packet() failing would clear the > CodedBitstreamFragment before returning, but if that's not the case then > ff_cbs_fragment_reset() should be called. >=20 > Would something like >=20 > > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c > > index 5cc5d87c64..d1a0f6eaa2 100644 > > --- a/libavcodec/av1dec.c > > +++ b/libavcodec/av1dec.c > > @@ -1461,6 +1461,7 @@ static int av1_receive_frame(AVCodecContext *avct= x, AVFrame *frame) > > ret =3D ff_cbs_read_packet(s->cbc, &s->current_obu, s->pkt= ); > > if (ret < 0) { > > av_packet_unref(s->pkt); > > + ff_cbs_fragment_reset(&s->current_obu); > > av_log(avctx, AV_LOG_ERROR, "Failed to read packet.\n"= ); > > return ret; > > } >=20 > Be enough? yes, that solves it and looks much better than my patch thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire --4MRJAMMELAbUsYLE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZHpNZwAKCRBhHseHBAsP q1rjAJwNSvnqwb17LK1i3JWlGROGV+kjPACfduVrx4URHN8xcsHQ6GAIo7/47r4= =C5Ey -----END PGP SIGNATURE----- --4MRJAMMELAbUsYLE-- --===============5030067953227409019== 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". --===============5030067953227409019==--