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 9DAD043B68 for ; Mon, 18 Jul 2022 18:56:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8D9F968B9B5; Mon, 18 Jul 2022 21:56:40 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B371068B859 for ; Mon, 18 Jul 2022 21:56:34 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id BDE051C0007 for ; Mon, 18 Jul 2022 18:56:33 +0000 (UTC) Date: Mon, 18 Jul 2022 20:56:32 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220718185632.GT2088045@pb2> References: <6301fb24-1d5d-b069-a773-0defdc2086df@ycbcr.xyz> MIME-Version: 1.0 In-Reply-To: <6301fb24-1d5d-b069-a773-0defdc2086df@ycbcr.xyz> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/pthread_frame: update the main avctx from the current, ThreadContext 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="===============6029001981445015559==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6029001981445015559== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QCC2I/2CckNfI+Tr" Content-Disposition: inline --QCC2I/2CckNfI+Tr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 09, 2022 at 08:45:31AM +0200, Steve Lhomme wrote: > Patch attached in the email. >=20 > In some cases, the submit packet can result in configurations changes of = the > hardware decoders. The previous HW context is then freed and a new one > created. That context is supposed to move up to the main context and the > other threads. >=20 > It appears that when more than 2 frame threads are involved, the new cont= ext > doesn't move in the right place (or rather at the right time). And it can > create a crash when reusing the old HW context. This patch fixes the issu= e I > could reproduce in VLC with DXVA decoding. >=20 > I have no idea if this is correct or the side effects induced by this. It > seems the right thing to do. Keeping the previous call exhibits the issue. > It seems odd the other existing thread context are not updated with the > current hwaccel_priv_data. But maybe they are updated later from the "mai= n" > thread context, in which case this patch seems solid. > pthread_frame.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > 2274e52382008f403c7bf52f76d608d2a56ef859 0001-avcodec-pthread_frame-upda= te-the-main-avctx-from-the.patch > From e8abeeff92f5d7b3b553acdb7595d40153cbec1e Mon Sep 17 00:00:00 2001 > From: Steve Lhomme > Date: Fri, 8 Jul 2022 11:49:27 +0200 > Subject: [PATCH] avcodec/pthread_frame: update the main avctx from the cu= rrent > ThreadContext >=20 > After a submit_decoder() the hwaccel_priv_data may have changed in that a= vctx. >=20 > Doing it after the "next available frame" loop will likely point to the > hwaccel_priv_data from another PerThreadContext which had the old value w= hich > might have been freed, if the submit_decoder() resulting in a format chan= ge. > --- > libavcodec/pthread_frame.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) It would be nice if a solution to this would make it in 5.1 thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In fact, the RIAA has been known to suggest that students drop out of college or go to community college in order to be able to afford settlements. -- The RIAA --QCC2I/2CckNfI+Tr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYtWs3AAKCRBhHseHBAsP q1zCAJwPaubOyb2QzH7EsQ/7snnZmysL3ACfeSOpMxG2d+ASRzNIuB1uuXQ2Fqs= =Y9IQ -----END PGP SIGNATURE----- --QCC2I/2CckNfI+Tr-- --===============6029001981445015559== 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". --===============6029001981445015559==--