diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-20 02:46:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-20 02:46:06 +0100 |
commit | dbb38bc389e1af5ed465ed370887d6af4da0cb40 (patch) | |
tree | 8998bdad7433fa92d6008ebb8a096e9dd1460340 /libavcodec/pthread.c | |
parent | 90c02ae1429b7f50cefdaeeca04b51f978cd1921 (diff) | |
parent | 09d243ddd0d939e97f3fe0b7f27320763ee41493 (diff) | |
download | ffmpeg-dbb38bc389e1af5ed465ed370887d6af4da0cb40.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
swscale: Fix stack alignment for SSE
avcodec: move some AVCodecContext fields to an internal struct.
avcodec: use av_opt_set() instead of deprecated av_set_string3()
avcodec: fix some const warnings
avcodec: remove pointless AVOption, internal_buffer_count
imgutils: Fix illegal read.
Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r-- | libavcodec/pthread.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 8eff782fcb..2096c53ab1 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -679,8 +679,10 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count) pthread_cond_destroy(&p->output_cond); av_freep(&p->avpkt.data); - if (i) + if (i) { av_freep(&p->avctx->priv_data); + av_freep(&p->avctx->internal); + } av_freep(&p->avctx); } @@ -734,9 +736,15 @@ static int frame_thread_init(AVCodecContext *avctx) update_context_from_thread(avctx, copy, 1); } else { - copy->is_copy = 1; copy->priv_data = av_malloc(codec->priv_data_size); memcpy(copy->priv_data, src->priv_data, codec->priv_data_size); + copy->internal = av_malloc(sizeof(AVCodecInternal)); + if (!copy->internal) { + err = AVERROR(ENOMEM); + goto error; + } + *(copy->internal) = *(src->internal); + copy->internal->is_copy = 1; if (codec->init_thread_copy) err = codec->init_thread_copy(copy); @@ -870,8 +878,7 @@ void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f) } if(avctx->debug & FF_DEBUG_BUFFERS) - av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p, %d buffers used\n", - f, f->owner->internal_buffer_count); + av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p\n", f); fctx = p->parent; pthread_mutex_lock(&fctx->buffer_mutex); |