mirror of https://git.ffmpeg.org/ffmpeg.git
lavc/decode: stop duplicating code from hwaccel_uninit()
This commit is contained in:
parent
a4611e3170
commit
3d2e1aa324
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue