You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
hwaccel: Deinitialize hardware acceleration early enough
The application will destroy the underlying hardware handles when
get_format() gets called again. Also this ensures the
deinitialization takes place if the get_format callback returns an
error.
Regression from 1c80c9d7ef
.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
committed by
Luca Barbato
parent
77ab341c0c
commit
4ff670d99b
@@ -948,6 +948,11 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
|
||||
memcpy(choices, fmt, (n + 1) * sizeof(*choices));
|
||||
|
||||
for (;;) {
|
||||
if (avctx->hwaccel && avctx->hwaccel->uninit)
|
||||
avctx->hwaccel->uninit(avctx);
|
||||
av_freep(&avctx->internal->hwaccel_priv_data);
|
||||
avctx->hwaccel = NULL;
|
||||
|
||||
ret = avctx->get_format(avctx, choices);
|
||||
|
||||
desc = av_pix_fmt_desc_get(ret);
|
||||
@@ -956,11 +961,6 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
|
||||
break;
|
||||
}
|
||||
|
||||
if (avctx->hwaccel && avctx->hwaccel->uninit)
|
||||
avctx->hwaccel->uninit(avctx);
|
||||
av_freep(&avctx->internal->hwaccel_priv_data);
|
||||
avctx->hwaccel = NULL;
|
||||
|
||||
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user