mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08:00
avcodec: Make init-threadsafety the default
and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -72,13 +72,13 @@ static AVMutex codec_mutex = AV_MUTEX_INITIALIZER;
|
||||
|
||||
static void lock_avcodec(const FFCodec *codec)
|
||||
{
|
||||
if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init)
|
||||
if (codec->caps_internal & FF_CODEC_CAP_NOT_INIT_THREADSAFE && codec->init)
|
||||
ff_mutex_lock(&codec_mutex);
|
||||
}
|
||||
|
||||
static void unlock_avcodec(const FFCodec *codec)
|
||||
{
|
||||
if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init)
|
||||
if (codec->caps_internal & FF_CODEC_CAP_NOT_INIT_THREADSAFE && codec->init)
|
||||
ff_mutex_unlock(&codec_mutex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user