Skip to content

Commit

Permalink
lavc/pthread_slice: release entries
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cgisquet authored and michaelni committed Feb 24, 2015
1 parent cc69ccb commit e87e206
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libavcodec/pthread_slice.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e87e206

Please sign in to comment.