aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-04-05 07:09:44 +0200
committerAnton Khirnov <anton@khirnov.net>2014-05-18 10:16:35 +0200
commite1b66778b6ee82a192b5895e23c4e135f7269326 (patch)
tree43cd90603953df62fdd85617111a779e8889ac73
parent584f88409062f7a134e7391887899e8e723ab6ff (diff)
downloadffmpeg-e1b66778b6ee82a192b5895e23c4e135f7269326.tar.gz
lavc: remove the locking code in avcodec_close()
This function should not modify any global state, so there should be no reason for any locking.
-rw-r--r--libavcodec/utils.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d5c307042e..71cbc57b44 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1684,19 +1684,6 @@ void avsubtitle_free(AVSubtitle *sub)
av_cold int avcodec_close(AVCodecContext *avctx)
{
- /* If there is a user-supplied mutex locking routine, call it. */
- if (lockmgr_cb) {
- if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
- return -1;
- }
-
- entangled_thread_counter++;
- if (entangled_thread_counter != 1) {
- av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
- entangled_thread_counter--;
- return -1;
- }
-
if (avcodec_is_open(avctx)) {
FramePool *pool = avctx->internal->pool;
int i;
@@ -1725,12 +1712,7 @@ av_cold int avcodec_close(AVCodecContext *avctx)
av_freep(&avctx->extradata);
avctx->codec = NULL;
avctx->active_thread_type = 0;
- entangled_thread_counter--;
- /* Release any user-supplied mutex. */
- if (lockmgr_cb) {
- (*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE);
- }
return 0;
}