diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-06 02:18:50 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-06 02:23:34 +0100 |
commit | d8cab5c26b0987f139830937e1f30b2a10822680 (patch) | |
tree | 1328facddcdaeac6881f32b7b3511806a68d2111 /libavcodec/utils.c | |
parent | 3b4798a87375c6090215185a87d51358cbb5af84 (diff) | |
parent | 18ae3626405a8b3d6dbb7e5b848d354cd7bf9a47 (diff) | |
download | ffmpeg-d8cab5c26b0987f139830937e1f30b2a10822680.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
http: Remove the custom function for disabling chunked posts
rtsp: Disable chunked http post through AVOptions
movdec: Set frame_size for AMR
h264_weight: remove duplication functions.
swscale: align vertical filtersize by 2 on x86.
libavfilter: reindent.
matroskadec: empty blocks are in fact valid.
avfilter: don't abort() on zero-size allocations.
h264: improve calculation of codec delay.
movenc: Set a correct packet size for AMR-NB mode 15, "no data"
avformat: Add functions for doing global network initialization
avformat: Add the https protocol
avformat: Add the tls protocol, using OpenSSL or gnutls
avformat: Initialize gnutls in ff_tls_init()
w32threads: Wrap the mutex functions in inline functions returning int
configure: Allow linking to the gnutls library
avformat: Add ff_tls_init()/deinit() that initialize OpenSSL
configure: Allow linking to openssl
avcodec: Allow locking and unlocking an avformat specific mutex
avformat: Split out functions from network.h to a new file, network.c
Conflicts:
Changelog
configure
doc/APIchanges
libavcodec/internal.h
libavcodec/version.h
libavfilter/formats.c
libavformat/matroskadec.c
libavformat/mov.c
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b4c9404e3e..7e0a8cff48 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -48,6 +48,7 @@ static int volatile entangled_thread_counter=0; static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op); static void *codec_mutex; +static void *avformat_mutex; void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size) { @@ -1378,6 +1379,8 @@ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) if (ff_lockmgr_cb) { if (ff_lockmgr_cb(&codec_mutex, AV_LOCK_DESTROY)) return -1; + if (ff_lockmgr_cb(&avformat_mutex, AV_LOCK_DESTROY)) + return -1; } ff_lockmgr_cb = cb; @@ -1385,6 +1388,26 @@ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) if (ff_lockmgr_cb) { if (ff_lockmgr_cb(&codec_mutex, AV_LOCK_CREATE)) return -1; + if (ff_lockmgr_cb(&avformat_mutex, AV_LOCK_CREATE)) + return -1; + } + return 0; +} + +int avpriv_lock_avformat(void) +{ + if (ff_lockmgr_cb) { + if ((*ff_lockmgr_cb)(&avformat_mutex, AV_LOCK_OBTAIN)) + return -1; + } + return 0; +} + +int avpriv_unlock_avformat(void) +{ + if (ff_lockmgr_cb) { + if ((*ff_lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE)) + return -1; } return 0; } |