return count;
}
-static int wavpack_decode_init(AVCodecContext *avctx)
+static av_cold int wavpack_decode_init(AVCodecContext *avctx)
{
WavpackContext *s = avctx->priv_data;
s->avctx = avctx;
s->stereo = (avctx->channels == 2);
+ avctx->sample_fmt = SAMPLE_FMT_S16;
+ avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
return 0;
}
static int wavpack_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size)
{
WavpackContext *s = avctx->priv_data;
int16_t *samples = data;
int samplecount;
int got_terms = 0, got_weights = 0, got_samples = 0, got_entropy = 0, got_bs = 0;
- uint8_t* buf_end = buf + buf_size;
+ const uint8_t* buf_end = buf + buf_size;
int i, j, id, size, ssize, weights, t;
if (buf_size == 0){
NULL,
NULL,
wavpack_decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("WavPack"),
};