summaryrefslogtreecommitdiff
path: root/libavcodec/wavpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r--libavcodec/wavpack.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 574ce15d08..b5663b45df 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -129,7 +129,6 @@ typedef struct WavpackFrameContext {
typedef struct WavpackContext {
AVCodecContext *avctx;
- AVFrame frame;
WavpackFrameContext *fdec[WV_MAX_FRAME_DECODERS];
int fdec_num;
@@ -741,9 +740,6 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
s->fdec_num = 0;
- avcodec_get_frame_defaults(&s->frame);
- avctx->coded_frame = &s->frame;
-
return 0;
}
@@ -1183,6 +1179,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
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;
@@ -1218,12 +1215,12 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
- s->frame.nb_samples = s->samples + 1;
- if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
+ frame->nb_samples = s->samples + 1;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- s->frame.nb_samples = s->samples;
+ frame->nb_samples = s->samples;
while (buf_size > 0) {
if (!s->multichannel) {
@@ -1244,7 +1241,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
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 AVERROR_INVALIDDATA;
@@ -1253,9 +1250,6 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
buf += frame_size; buf_size -= frame_size;
}
- if (*got_frame_ptr)
- *(AVFrame *)data = s->frame;
-
return avpkt->size;
}