lavc/decode: stop duplicating code from hwaccel_uninit()

This commit is contained in:
Anton Khirnov 2023-04-28 11:48:04 +02:00 committed by Lynne
parent a4611e3170
commit 3d2e1aa324
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
3 changed files with 5 additions and 5 deletions

View File

@ -39,6 +39,7 @@
#include "decode.h"
#include "encode.h"
#include "frame_thread_encoder.h"
#include "hwconfig.h"
#include "internal.h"
#include "thread.h"
@ -459,9 +460,7 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_buffer_unref(&avci->pool);
if (avctx->hwaccel && avctx->hwaccel->uninit)
avctx->hwaccel->uninit(avctx);
av_freep(&avci->hwaccel_priv_data);
ff_hwaccel_uninit(avctx);
av_bsf_free(&avci->bsf);

View File

@ -1145,7 +1145,7 @@ static int hwaccel_init(AVCodecContext *avctx,
return 0;
}
static void hwaccel_uninit(AVCodecContext *avctx)
void ff_hwaccel_uninit(AVCodecContext *avctx)
{
if (avctx->hwaccel && avctx->hwaccel->uninit)
avctx->hwaccel->uninit(avctx);
@ -1184,7 +1184,7 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
for (;;) {
// Remove the previous hwaccel, if there was one.
hwaccel_uninit(avctx);
ff_hwaccel_uninit(avctx);
user_choice = avctx->get_format(avctx, choices);
if (user_choice == AV_PIX_FMT_NONE) {

View File

@ -39,6 +39,7 @@ typedef struct AVCodecHWConfigInternal {
const AVHWAccel *hwaccel;
} AVCodecHWConfigInternal;
void ff_hwaccel_uninit(AVCodecContext *avctx);
// These macros are used to simplify AVCodecHWConfigInternal definitions.