aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wavpack.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-06-03 16:22:46 +0000
committerPaul B Mahol <onemda@gmail.com>2013-06-05 22:35:32 +0000
commit9684d7f1a2264b45eb0a697b0d720a6cd5c35ea6 (patch)
tree85737d60f6aefd09642741cd02321f30b135b7ae /libavcodec/wavpack.c
parent495db0e3b097924d38e297132cb15c9efe1b3e43 (diff)
downloadffmpeg-9684d7f1a2264b45eb0a697b0d720a6cd5c35ea6.tar.gz
wavpack: frame multi-threading support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r--libavcodec/wavpack.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 6d16d168dc..48323315b3 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -25,6 +25,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
+#include "thread.h"
#include "unary.h"
#include "bytestream.h"
@@ -754,6 +755,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
AVFrame *frame, const uint8_t *buf, int buf_size)
{
WavpackContext *wc = avctx->priv_data;
+ ThreadFrame tframe = { .f = frame };
WavpackFrameContext *s;
GetByteContext gb;
void *samples_l, *samples_r;
@@ -1120,7 +1122,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
/* get output buffer */
frame->nb_samples = s->samples + 1;
- if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+ if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
return ret;
frame->nb_samples = s->samples;
}
@@ -1236,6 +1238,6 @@ AVCodec ff_wavpack_decoder = {
.close = wavpack_decode_end,
.decode = wavpack_decode_frame,
.flush = wavpack_decode_flush,
- .capabilities = CODEC_CAP_DR1,
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("WavPack"),
};