From c0b102ca03fe92250f1ce620aec3836f529fc1d6 Mon Sep 17 00:00:00 2001 From: Alexander Strange Date: Mon, 7 Feb 2011 21:15:45 -0500 Subject: Deprecate avcodec_thread_init() As a side effect of the last commit, avcodec_open() now calls it automatically, so there is no longer any need for clients to call it. Instead they should set AVCodecContext.thread_count. avcodec_thread_free() is deprecated, and will be removed from avcodec.h at the next MAJOR libavcodec bump. Rename the functions to ff_thread_init/free, since they are now internal. Wrappers are provided to maintain API compatibility. Signed-off-by: Ronald S. Bultje --- libavcodec/pthread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavcodec/pthread.c') diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 00e419bf0c..0e033d37c0 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -256,7 +256,7 @@ static int thread_init(AVCodecContext *avctx) if(pthread_create(&c->workers[i], NULL, worker, avctx)) { avctx->thread_count = i; pthread_mutex_unlock(&c->current_job_lock); - avcodec_thread_free(avctx); + ff_thread_free(avctx); return -1; } } @@ -870,7 +870,7 @@ static void validate_thread_parameters(AVCodecContext *avctx) } } -int avcodec_thread_init(AVCodecContext *avctx, int thread_count) +int ff_thread_init(AVCodecContext *avctx, int thread_count) { if (avctx->thread_opaque) { av_log(avctx, AV_LOG_ERROR, "avcodec_thread_init is ignored after avcodec_open\n"); @@ -891,7 +891,7 @@ int avcodec_thread_init(AVCodecContext *avctx, int thread_count) return 0; } -void avcodec_thread_free(AVCodecContext *avctx) +void ff_thread_free(AVCodecContext *avctx) { if (avctx->active_thread_type&FF_THREAD_FRAME) frame_thread_free(avctx, avctx->thread_count); -- cgit v1.2.3