Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/pthread_frame: update the main avctx from the current, ThreadContext
Date: Mon, 18 Jul 2022 20:56:32 +0200
Message-ID: <20220718185632.GT2088045@pb2> (raw)
In-Reply-To: <6301fb24-1d5d-b069-a773-0defdc2086df@ycbcr.xyz>


[-- Attachment #1.1: Type: text/plain, Size: 2203 bytes --]

On Sat, Jul 09, 2022 at 08:45:31AM +0200, Steve Lhomme wrote:
> Patch attached in the email.
> 
> 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.
> 
> It appears that when more than 2 frame threads are involved, the new context
> 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 issue I
> could reproduce in VLC with DXVA decoding.
> 
> 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 "main"
> 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-update-the-main-avctx-from-the.patch
> From e8abeeff92f5d7b3b553acdb7595d40153cbec1e Mon Sep 17 00:00:00 2001
> From: Steve Lhomme <robux4@ycbcr.xyz>
> Date: Fri, 8 Jul 2022 11:49:27 +0200
> Subject: [PATCH] avcodec/pthread_frame: update the main avctx from the current
>  ThreadContext
> 
> After a submit_decoder() the hwaccel_priv_data may have changed in that avctx.
> 
> Doing it after the "next available frame" loop will likely point to the
> hwaccel_priv_data from another PerThreadContext which had the old value which
> might have been freed, if the submit_decoder() resulting in a format change.
> ---
>  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

[...]

-- 
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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

  reply	other threads:[~2022-07-18 18:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  6:45 Steve Lhomme
2022-07-18 18:56 ` Michael Niedermayer [this message]
2022-07-22 16:22   ` Michael Niedermayer
2022-08-02 14:19 ` Anton Khirnov
2022-08-19  8:07   ` Steve Lhomme
2022-08-23 17:53     ` Michael Niedermayer
2022-09-02  8:02     ` Anton Khirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220718185632.GT2088045@pb2 \
    --to=michael@niedermayer.cc \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git