summaryrefslogtreecommitdiff
path: root/libavcodec/vp8.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-07-15 00:11:35 +0300
committerMartin Storsjö <martin@martin.st>2012-07-15 13:55:18 +0300
commit25f056e6d4229937cff8a8c3e974c56b9f94df3c (patch)
tree3cfd6db7dae39d15f30176186542cf4148857b30 /libavcodec/vp8.c
parentc44091a9f70d9f9987f022dc9da0109879d2eb82 (diff)
vp8: Enclose pthread function calls in ifdefs
This fixes building with threads disabled. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r--libavcodec/vp8.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index e39fc0bf93..d0e2a0cccb 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -143,8 +143,10 @@ static int update_dimensions(VP8Context *s, int width, int height)
for (i = 0; i < MAX_THREADS; i++) {
s->thread_data[i].filter_strength = av_mallocz(s->mb_width*sizeof(*s->thread_data[0].filter_strength));
+#if HAVE_THREADS
pthread_mutex_init(&s->thread_data[i].lock, NULL);
pthread_cond_init(&s->thread_data[i].cond, NULL);
+#endif
}
if (!s->macroblocks_base || !s->top_nnz || !s->top_border ||
@@ -1623,6 +1625,7 @@ static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, AVFrame *curframe,
}
}
+#if HAVE_THREADS
#define check_thread_pos(td, otd, mb_x_check, mb_y_check)\
do {\
int tmp = (mb_y_check << 16) | (mb_x_check & 0xFFFF);\
@@ -1654,6 +1657,10 @@ static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, AVFrame *curframe,
pthread_mutex_unlock(&td->lock);\
}\
} while(0);
+#else
+#define check_thread_pos(td, otd, mb_x_check, mb_y_check)
+#define update_pos(td, mb_y, mb_x)
+#endif
static void vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr)