diff options
author | Anton Khirnov <anton@khirnov.net> | 2017-01-09 18:04:42 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-04-10 15:24:54 +0200 |
commit | 1f4cf92cfbd3accbae582ac63126ed5570ddfd37 (patch) | |
tree | 0d08c281a748689d53350a929fb0df022dc6ef2c /libavcodec/pixlet.c | |
parent | 665e5b0fba41a8bae2269d9ce8929a24002e5907 (diff) | |
download | ffmpeg-1f4cf92cfbd3accbae582ac63126ed5570ddfd37.tar.gz |
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).
Diffstat (limited to 'libavcodec/pixlet.c')
-rw-r--r-- | libavcodec/pixlet.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 03a2cdacc8..7b068b1ce5 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -675,28 +675,12 @@ static int pixlet_decode_frame(AVCodecContext *avctx, void *data, return pktsize; } -#if HAVE_THREADS -static int pixlet_init_thread_copy(AVCodecContext *avctx) -{ - PixletContext *ctx = avctx->priv_data; - - ctx->filter[0] = NULL; - ctx->filter[1] = NULL; - ctx->prediction = NULL; - ctx->w = 0; - ctx->h = 0; - - return 0; -} -#endif /* HAVE_THREADS */ - AVCodec ff_pixlet_decoder = { .name = "pixlet", .long_name = NULL_IF_CONFIG_SMALL("Apple Pixlet"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_PIXLET, .init = pixlet_init, - .init_thread_copy = ONLY_IF_THREADS_ENABLED(pixlet_init_thread_copy), .close = pixlet_close, .decode = pixlet_decode_frame, .priv_data_size = sizeof(PixletContext), |