summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4video.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-04 06:12:27 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-09 09:32:53 +0100
commit832ead2ec40392e73422f9a9d3ab1f21ea025207 (patch)
tree533eaacbea16cba0b48dda2d1369da09c55d59ac /libavcodec/mpeg4video.h
parentf0194e860e33cb60a80305eae2262b2e7977c908 (diff)
downloadffmpeg-832ead2ec40392e73422f9a9d3ab1f21ea025207.tar.gz
avcodec/mpeg4videodec: Fix data race when initializing VLCs
Both the MPEG-4 parser as well as the decoder initialized several VLCs. There is a "static int done = 0;" in order to guard against initializing these multiple times, but this does not work when several threads try to initialize these VLCs concurrently, which can happen when initializing several parsers at the same time (they don't use the global lock that is used for codecs without the FF_CODEC_CAP_INIT_THREADSAFE cap; actually, they don't use any lock at all). Since ff_mpeg4_decode_picture_header() now aborts early when called from the parser, it no longer needs to have these VLCs initialized at all. This commit therefore does exactly this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpeg4video.h')
-rw-r--r--libavcodec/mpeg4video.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index ee8eea7121..cec8b30c32 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -173,7 +173,6 @@ int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s);
int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx);
int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx);
void ff_mpeg4_init_direct_mv(MpegEncContext *s);
-void ff_mpeg4videodec_static_init(void);
int ff_mpeg4_workaround_bugs(AVCodecContext *avctx);
int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size);