summaryrefslogtreecommitdiff
path: root/libavcodec/pthread_slice.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-10-27 13:00:37 +0100
committerAnton Khirnov <anton@khirnov.net>2013-11-04 08:51:26 +0100
commit38ecc3702dabbea09230f6d6333f59e74f5d1c12 (patch)
treef579350e0fc85ce1cb42646b2f13a5ed9a6895af /libavcodec/pthread_slice.c
parentdaa7a1d4431b6acf1f93c4a98b3de123abf4ca18 (diff)
pthread: store thread contexts in AVCodecInternal instead of AVCodecContext
It's a private field, it should not be visible to callers. Deprecate AVCodecContext.thread_opaque
Diffstat (limited to 'libavcodec/pthread_slice.c')
-rw-r--r--libavcodec/pthread_slice.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/pthread_slice.c b/libavcodec/pthread_slice.c
index cf9805ffd0..d7c73f0884 100644
--- a/libavcodec/pthread_slice.c
+++ b/libavcodec/pthread_slice.c
@@ -63,7 +63,7 @@ typedef struct SliceThreadContext {
static void* attribute_align_arg worker(void *v)
{
AVCodecContext *avctx = v;
- SliceThreadContext *c = avctx->thread_opaque;
+ SliceThreadContext *c = avctx->internal->thread_ctx;
unsigned last_execute = 0;
int our_job = c->job_count;
int thread_count = avctx->thread_count;
@@ -98,7 +98,7 @@ static void* attribute_align_arg worker(void *v)
void ff_slice_thread_free(AVCodecContext *avctx)
{
- SliceThreadContext *c = avctx->thread_opaque;
+ SliceThreadContext *c = avctx->internal->thread_ctx;
int i;
pthread_mutex_lock(&c->current_job_lock);
@@ -113,7 +113,7 @@ void ff_slice_thread_free(AVCodecContext *avctx)
pthread_cond_destroy(&c->current_job_cond);
pthread_cond_destroy(&c->last_job_cond);
av_free(c->workers);
- av_freep(&avctx->thread_opaque);
+ av_freep(&avctx->internal->thread_ctx);
}
static av_always_inline void thread_park_workers(SliceThreadContext *c, int thread_count)
@@ -125,7 +125,7 @@ static av_always_inline void thread_park_workers(SliceThreadContext *c, int thre
static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size)
{
- SliceThreadContext *c = avctx->thread_opaque;
+ SliceThreadContext *c = avctx->internal->thread_ctx;
int dummy_ret;
if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1)
@@ -158,7 +158,7 @@ static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, i
static int thread_execute2(AVCodecContext *avctx, action_func2* func2, void *arg, int *ret, int job_count)
{
- SliceThreadContext *c = avctx->thread_opaque;
+ SliceThreadContext *c = avctx->internal->thread_ctx;
c->func2 = func2;
return thread_execute(avctx, NULL, arg, ret, job_count, 0);
}
@@ -198,7 +198,7 @@ int ff_slice_thread_init(AVCodecContext *avctx)
return -1;
}
- avctx->thread_opaque = c;
+ avctx->internal->thread_ctx = c;
c->current_job = 0;
c->job_count = 0;
c->job_size = 0;