summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 58689a4370..36be83948e 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3506,11 +3506,13 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
else
s->threads_number = 1;
- if (avctx->extradata_size > 0 && avctx->extradata) {
- ret = hevc_decode_extradata(s, avctx->extradata, avctx->extradata_size, 1);
- if (ret < 0) {
- hevc_decode_free(avctx);
- return ret;
+ if (!avctx->internal->is_copy) {
+ if (avctx->extradata_size > 0 && avctx->extradata) {
+ ret = hevc_decode_extradata(s, avctx->extradata, avctx->extradata_size, 1);
+ if (ret < 0) {
+ hevc_decode_free(avctx);
+ return ret;
+ }
}
}
@@ -3522,22 +3524,6 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
return 0;
}
-#if HAVE_THREADS
-static av_cold int hevc_init_thread_copy(AVCodecContext *avctx)
-{
- HEVCContext *s = avctx->priv_data;
- int ret;
-
- memset(s, 0, sizeof(*s));
-
- ret = hevc_init_context(avctx);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-#endif
-
static void hevc_decode_flush(AVCodecContext *avctx)
{
HEVCContext *s = avctx->priv_data;
@@ -3577,7 +3563,6 @@ AVCodec ff_hevc_decoder = {
.decode = hevc_decode_frame,
.flush = hevc_decode_flush,
.update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context),
- .init_thread_copy = ONLY_IF_THREADS_ENABLED(hevc_init_thread_copy),
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING |