summaryrefslogtreecommitdiff
path: root/libavcodec/pthread.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-25 16:01:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-25 16:01:42 +0200
commit8f0db04b086925f5358ef605e2a77bee041e5dbf (patch)
tree99b12614d1867c6da91f1abbda535740871b1ae2 /libavcodec/pthread.c
parent94b3a666fa87f96c4ed2b469bbc28e1ac4e67785 (diff)
downloadffmpeg-8f0db04b086925f5358ef605e2a77bee041e5dbf.tar.gz
avcodec/pthread: use THREAD_SAFE_CALLBACKS() to simplifx more code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r--libavcodec/pthread.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 871fb6e2bc..516e5fcfd0 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -959,11 +959,7 @@ int ff_thread_can_start_frame(AVCodecContext *avctx)
{
PerThreadContext *p = avctx->thread_opaque;
if ((avctx->active_thread_type&FF_THREAD_FRAME) && p->state != STATE_SETTING_UP &&
- (avctx->codec->update_thread_context || (!avctx->thread_safe_callbacks && (
-#if FF_API_GET_BUFFER
- avctx->get_buffer ||
-#endif
- avctx->get_buffer2 != avcodec_default_get_buffer2)))) {
+ (avctx->codec->update_thread_context || !THREAD_SAFE_CALLBACKS(avctx))) {
return 0;
}
return 1;
@@ -982,11 +978,7 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int
return ff_get_buffer(avctx, f->f, flags);
if (p->state != STATE_SETTING_UP &&
- (avctx->codec->update_thread_context || (!avctx->thread_safe_callbacks && (
-#if FF_API_GET_BUFFER
- avctx->get_buffer ||
-#endif
- avctx->get_buffer2 != avcodec_default_get_buffer2)))) {
+ (avctx->codec->update_thread_context || !THREAD_SAFE_CALLBACKS(avctx))) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n");
return -1;
}