[FFmpeg-devel] [PATCH] avcodec/pthread_frame: update the main avctx from the current, ThreadContext

Anton Khirnov anton at khirnov.net
Fri Sep 2 11:02:45 EEST 2022


Quoting Steve Lhomme (2022-08-19 10:07:54)
> Hi,
> 
> On 2022-08-02 16:19, Anton Khirnov wrote:
> > Why are you not resubmitting your original patch that stops copying
> > hwaccel_priv_data to the user-facing context?
> > 
> > It seemed more correct to me, since the user-facing context should never
> > see any hwaccel data. Or does it not fix the issue fully?
> 
> The original patch is not fixing it properly. With that patch and 
> avcodec-threads > 1, the uninit of the hardware decoder is not called 
> anymore. So it will replace a crash fix with a (big) resource leak.
> 
> For reference, this it the patch we're talking about
> https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg94274.html

A problem with this patch is that currently the user-facing codec
context will contain values corresponding to the last output frame.
You're changing it to contain values corresponding to the thread a new
packet was submitted to, which is wrong.

I'll try to write a better patch, could you tell me exactly how to
reproduce the crash?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list