diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-10-12 15:25:51 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2015-10-12 15:25:51 -0300 |
commit | 1156b634c18fcbaa0d107df8135578031242815c (patch) | |
tree | 6cee5a9aa248391650b78c97a417a82b667490c5 | |
parent | ccd3b3df39de4c2c4e30fb2012675f99e56dbc5e (diff) | |
download | ffmpeg-1156b634c18fcbaa0d107df8135578031242815c.tar.gz |
avcodec: Don't lock on init for codecs without an init function
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 175106714d..0e4f3c0964 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3266,7 +3266,7 @@ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec) { - if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) + if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init) return 0; if (lockmgr_cb) { @@ -3292,7 +3292,7 @@ int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec) int ff_unlock_avcodec(const AVCodec *codec) { - if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) + if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init) return 0; av_assert0(ff_avcodec_locked); |