Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (65 commits) riff: Add mpgv MPEG-2 fourcc Update Changelog matroskadec: fix integer underflow if header length < probe length. ffmpeg: fix operation with --disable-avfilter vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h build: Create mlib optimization directories during out-of-tree builds. changelog: misc typo and wording fixes (cherry picked from commitb047941d7d
) doc: Remove outdated comments about gcc 2.95 and gcc 3.3 support. (cherry picked from commit5ccbf80963
) matroskadec: matroska_read_seek after after EBML_STOP leads to failure. Update RELEASE file update Changelog mt: proper locking around release_buffer calls. vp8/mt: flush worker thread, not application thread context, on seek. docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue docs: Use proper markup for a literal command line option docs: Don't recommend adding --enable-memalign-hack docs: Remove needless configure options oggdec: prevent heap corruption. oggdec: Abort Ogg header parsing when encountering a data packet. Add LGPL license boilerplate to files lacking it. ... Conflicts: Changelog configure doc/developer.texi libavcodec/libvpxenc.c libavcodec/rawdec.c libavfilter/x86/gradfun.c libavformat/Makefile libavformat/isom.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -408,9 +408,10 @@ static void release_delayed_buffers(PerThreadContext *p)
|
||||
FrameThreadContext *fctx = p->parent;
|
||||
|
||||
while (p->num_released_buffers > 0) {
|
||||
AVFrame *f = &p->released_buffers[--p->num_released_buffers];
|
||||
AVFrame *f;
|
||||
|
||||
pthread_mutex_lock(&fctx->buffer_mutex);
|
||||
f = &p->released_buffers[--p->num_released_buffers];
|
||||
free_progress(f);
|
||||
f->thread_opaque = NULL;
|
||||
|
||||
@@ -746,9 +747,12 @@ void ff_thread_flush(AVCodecContext *avctx)
|
||||
if (!avctx->thread_opaque) return;
|
||||
|
||||
park_frame_worker_threads(fctx, avctx->thread_count);
|
||||
|
||||
if (fctx->prev_thread)
|
||||
update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0);
|
||||
if (fctx->prev_thread) {
|
||||
if (fctx->prev_thread != &fctx->threads[0])
|
||||
update_context_from_thread(fctx->threads[0].avctx, fctx->prev_thread->avctx, 0);
|
||||
if (avctx->codec->flush)
|
||||
avctx->codec->flush(fctx->threads[0].avctx);
|
||||
}
|
||||
|
||||
fctx->next_decoding = fctx->next_finished = 0;
|
||||
fctx->delaying = 1;
|
||||
@@ -836,6 +840,7 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f)
|
||||
void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
|
||||
{
|
||||
PerThreadContext *p = avctx->thread_opaque;
|
||||
FrameThreadContext *fctx;
|
||||
|
||||
if (!(avctx->active_thread_type&FF_THREAD_FRAME)) {
|
||||
avctx->release_buffer(avctx, f);
|
||||
@@ -851,7 +856,10 @@ void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f)
|
||||
av_log(avctx, AV_LOG_DEBUG, "thread_release_buffer called on pic %p, %d buffers used\n",
|
||||
f, f->owner->internal_buffer_count);
|
||||
|
||||
fctx = p->parent;
|
||||
pthread_mutex_lock(&fctx->buffer_mutex);
|
||||
p->released_buffers[p->num_released_buffers++] = *f;
|
||||
pthread_mutex_unlock(&fctx->buffer_mutex);
|
||||
memset(f->data, 0, sizeof(f->data));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user