#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "get_bits.h"
+#include "internal.h"
#include "unary.h"
/**
typedef struct WavpackContext {
AVCodecContext *avctx;
- AVFrame frame;
WavpackFrameContext *fdec[WV_MAX_FRAME_DECODERS];
int fdec_num;
s->fdec_num = 0;
- avcodec_get_frame_defaults(&s->frame);
- avctx->coded_frame = &s->frame;
-
return 0;
}
WavpackContext *s = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
+ AVFrame *frame = data;
int frame_size, ret, frame_flags;
int samplecount = 0;
}
/* get output buffer */
- s->frame.nb_samples = s->samples;
- if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
+ frame->nb_samples = s->samples;
+ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
return -1;
}
if ((samplecount = wavpack_decode_block(avctx, s->block,
- s->frame.data[0], got_frame_ptr,
+ frame->data[0], got_frame_ptr,
buf, frame_size)) < 0) {
wavpack_decode_flush(avctx);
return -1;
buf += frame_size; buf_size -= frame_size;
}
- if (*got_frame_ptr)
- *(AVFrame *)data = s->frame;
-
return avpkt->size;
}