From 1f4cf92cfbd3accbae582ac63126ed5570ddfd37 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 9 Jan 2017 18:04:42 +0100 Subject: pthread_frame: merge the functionality for normal decoder init and init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once). --- libavcodec/proresdec2.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'libavcodec/proresdec2.c') diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 2652a31c81..d5fbfc6711 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -807,17 +807,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -#if HAVE_THREADS -static int decode_init_thread_copy(AVCodecContext *avctx) -{ - ProresContext *ctx = avctx->priv_data; - - ctx->slices = NULL; - - return 0; -} -#endif - static av_cold int decode_close(AVCodecContext *avctx) { ProresContext *ctx = avctx->priv_data; @@ -834,7 +823,6 @@ AVCodec ff_prores_decoder = { .id = AV_CODEC_ID_PRORES, .priv_data_size = sizeof(ProresContext), .init = decode_init, - .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy), .close = decode_close, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, -- cgit v1.2.3