diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2015-02-05 16:00:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-24 12:07:20 +0100 |
commit | e87e20613b013aa56b183c7e956ddaeaa76efa51 (patch) | |
tree | d1ad74ed3b5f9a2c3e40693df4518ba3d7e611e8 /libavcodec/pthread_slice.c | |
parent | cc69ccb6d44042b1f795da66306116b0964af996 (diff) | |
download | ffmpeg-e87e20613b013aa56b183c7e956ddaeaa76efa51.tar.gz |
lavc/pthread_slice: release entries
When calling ff_alloc_entries, a number of entries are created.
They are never freed, as running fate with slice threading and
several frames on e.g. fate-hevc-conformance-ENTP_A_Qualcomm_1
would show.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread_slice.c')
-rw-r--r-- | libavcodec/pthread_slice.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/pthread_slice.c b/libavcodec/pthread_slice.c index b948e16d24..c8e69f0a9a 100644 --- a/libavcodec/pthread_slice.c +++ b/libavcodec/pthread_slice.c @@ -112,14 +112,26 @@ void ff_slice_thread_free(AVCodecContext *avctx) pthread_mutex_lock(&c->current_job_lock); c->done = 1; pthread_cond_broadcast(&c->current_job_cond); + for (i = 0; i < c->thread_count; i++) + pthread_cond_broadcast(&c->progress_cond[i]); pthread_mutex_unlock(&c->current_job_lock); for (i=0; i<avctx->thread_count; i++) pthread_join(c->workers[i], NULL); + for (i = 0; i < c->thread_count; i++) { + pthread_mutex_destroy(&c->progress_mutex[i]); + pthread_cond_destroy(&c->progress_cond[i]); + } + pthread_mutex_destroy(&c->current_job_lock); pthread_cond_destroy(&c->current_job_cond); pthread_cond_destroy(&c->last_job_cond); + + av_freep(&c->entries); + av_freep(&c->progress_mutex); + av_freep(&c->progress_cond); + av_freep(&c->workers); av_freep(&avctx->internal->thread_ctx); } |