Commit 1581caa7 authored by Jun Zhao's avatar Jun Zhao Committed by Jun Zhao

lavc/hevcdec: add ONLY_IF_THREADS_ENABLED where it is missing.

add ONLY_IF_THREADS_ENABLED where it is missing.
Signed-off-by: 's avatarJun Zhao <mypopydev@gmail.com>
Reviewed-by: 's avatarJames Almer <jamrial@gmail.com>
parent eb1860e0
...@@ -3358,6 +3358,7 @@ fail: ...@@ -3358,6 +3358,7 @@ fail:
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
#if HAVE_THREADS
static int hevc_update_thread_context(AVCodecContext *dst, static int hevc_update_thread_context(AVCodecContext *dst,
const AVCodecContext *src) const AVCodecContext *src)
{ {
...@@ -3439,6 +3440,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, ...@@ -3439,6 +3440,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
return 0; return 0;
} }
#endif
static av_cold int hevc_decode_init(AVCodecContext *avctx) static av_cold int hevc_decode_init(AVCodecContext *avctx)
{ {
...@@ -3478,6 +3480,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx) ...@@ -3478,6 +3480,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
#if HAVE_THREADS
static av_cold int hevc_init_thread_copy(AVCodecContext *avctx) static av_cold int hevc_init_thread_copy(AVCodecContext *avctx)
{ {
HEVCContext *s = avctx->priv_data; HEVCContext *s = avctx->priv_data;
...@@ -3491,6 +3494,7 @@ static av_cold int hevc_init_thread_copy(AVCodecContext *avctx) ...@@ -3491,6 +3494,7 @@ static av_cold int hevc_init_thread_copy(AVCodecContext *avctx)
return 0; return 0;
} }
#endif
static void hevc_decode_flush(AVCodecContext *avctx) static void hevc_decode_flush(AVCodecContext *avctx)
{ {
...@@ -3529,8 +3533,8 @@ AVCodec ff_hevc_decoder = { ...@@ -3529,8 +3533,8 @@ AVCodec ff_hevc_decoder = {
.close = hevc_decode_free, .close = hevc_decode_free,
.decode = hevc_decode_frame, .decode = hevc_decode_frame,
.flush = hevc_decode_flush, .flush = hevc_decode_flush,
.update_thread_context = hevc_update_thread_context, .update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
.init_thread_copy = hevc_init_thread_copy, .init_thread_copy = ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment