volatile int ff_avcodec_locked;
static int volatile entangled_thread_counter = 0;
-static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
+static int (*lockmgr_cb)(void **mutex, enum AVLockOp op);
static void *codec_mutex;
static void *avformat_mutex;
MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)
+MAKE_ACCESSORS(AVCodecContext, codec, int, lowres)
static void avcodec_get_subtitle_defaults(AVSubtitle *sub)
{
if (!avctx->refcounted_frames) {
avci->to_free = *picture;
avci->to_free.extended_data = avci->to_free.data;
+ memset(picture->buf, 0, sizeof(picture->buf));
}
avctx->frame_number++;
if (!avctx->refcounted_frames) {
avci->to_free = *frame;
avci->to_free.extended_data = avci->to_free.data;
+ memset(frame->buf, 0, sizeof(frame->buf));
+ frame->extended_buf = NULL;
+ frame->nb_extended_buf = 0;
}
}
int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op))
{
- if (ff_lockmgr_cb) {
- if (ff_lockmgr_cb(&codec_mutex, AV_LOCK_DESTROY))
+ if (lockmgr_cb) {
+ if (lockmgr_cb(&codec_mutex, AV_LOCK_DESTROY))
return -1;
- if (ff_lockmgr_cb(&avformat_mutex, AV_LOCK_DESTROY))
+ if (lockmgr_cb(&avformat_mutex, AV_LOCK_DESTROY))
return -1;
}
- ff_lockmgr_cb = cb;
+ lockmgr_cb = cb;
- if (ff_lockmgr_cb) {
- if (ff_lockmgr_cb(&codec_mutex, AV_LOCK_CREATE))
+ if (lockmgr_cb) {
+ if (lockmgr_cb(&codec_mutex, AV_LOCK_CREATE))
return -1;
- if (ff_lockmgr_cb(&avformat_mutex, AV_LOCK_CREATE))
+ if (lockmgr_cb(&avformat_mutex, AV_LOCK_CREATE))
return -1;
}
return 0;
int ff_lock_avcodec(AVCodecContext *log_ctx)
{
- if (ff_lockmgr_cb) {
- if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
+ if (lockmgr_cb) {
+ if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
return -1;
}
entangled_thread_counter++;
av_assert0(ff_avcodec_locked);
ff_avcodec_locked = 0;
entangled_thread_counter--;
- if (ff_lockmgr_cb) {
- if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE))
+ if (lockmgr_cb) {
+ if ((*lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE))
return -1;
}
return 0;
int avpriv_lock_avformat(void)
{
- if (ff_lockmgr_cb) {
- if ((*ff_lockmgr_cb)(&avformat_mutex, AV_LOCK_OBTAIN))
+ if (lockmgr_cb) {
+ if ((*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))
+ if (lockmgr_cb) {
+ if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE))
return -1;
}
return 0;