You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
wavpack: frame multi-threading support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "thread.h"
|
||||||
#include "unary.h"
|
#include "unary.h"
|
||||||
#include "bytestream.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)
|
AVFrame *frame, const uint8_t *buf, int buf_size)
|
||||||
{
|
{
|
||||||
WavpackContext *wc = avctx->priv_data;
|
WavpackContext *wc = avctx->priv_data;
|
||||||
|
ThreadFrame tframe = { .f = frame };
|
||||||
WavpackFrameContext *s;
|
WavpackFrameContext *s;
|
||||||
GetByteContext gb;
|
GetByteContext gb;
|
||||||
void *samples_l, *samples_r;
|
void *samples_l, *samples_r;
|
||||||
@@ -1120,7 +1122,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
|
|||||||
|
|
||||||
/* get output buffer */
|
/* get output buffer */
|
||||||
frame->nb_samples = s->samples + 1;
|
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;
|
return ret;
|
||||||
frame->nb_samples = s->samples;
|
frame->nb_samples = s->samples;
|
||||||
}
|
}
|
||||||
@@ -1236,6 +1238,6 @@ AVCodec ff_wavpack_decoder = {
|
|||||||
.close = wavpack_decode_end,
|
.close = wavpack_decode_end,
|
||||||
.decode = wavpack_decode_frame,
|
.decode = wavpack_decode_frame,
|
||||||
.flush = wavpack_decode_flush,
|
.flush = wavpack_decode_flush,
|
||||||
.capabilities = CODEC_CAP_DR1,
|
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("WavPack"),
|
.long_name = NULL_IF_CONFIG_SMALL("WavPack"),
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user