summaryrefslogtreecommitdiffstats
path: root/libavcodec/binkaudio.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:45:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:45:25 +0100
commitf03cdbd0454fbdba53a123a8f95186a519fade8d (patch)
treec7386c765f42c684b931dcefb6382d4aadf43e5a /libavcodec/binkaudio.c
parentd13f434dbb55348b3ed761e4f4c2ff9c7be4ea4b (diff)
parent5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20 (diff)
downloadffmpeg-streaming-f03cdbd0454fbdba53a123a8f95186a519fade8d.zip
ffmpeg-streaming-f03cdbd0454fbdba53a123a8f95186a519fade8d.tar.gz
Merge commit '5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20'
* commit '5cc0bd2cb47cbb1040f2bb0ded8d72a442c79b20': binkaudio: decode directly to the user-provided AVFrame atrac3: decode directly to the user-provided AVFrame atrac1: decode directly to the user-provided AVFrame ape: decode directly to the user-provided AVFrame amrwb: decode directly to the user-provided AVFrame Conflicts: libavcodec/amrwbdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/binkaudio.c')
-rw-r--r--libavcodec/binkaudio.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 6fe14df..fdcf5c8 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -47,7 +47,6 @@ static float quant_table[96];
#define BINK_BLOCK_MAX_SIZE (MAX_CHANNELS << 11)
typedef struct {
- AVFrame frame;
GetBitContext gb;
int version_b; ///< Bink version 'b'
int first;
@@ -143,9 +142,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
else
return -1;
- avcodec_get_frame_defaults(&s->frame);
- avctx->coded_frame = &s->frame;
-
return 0;
}
@@ -294,6 +290,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
BinkAudioContext *s = avctx->priv_data;
+ AVFrame *frame = data;
GetBitContext *gb = &s->gb;
int ret, consumed = 0;
@@ -321,22 +318,21 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
/* get output buffer */
- s->frame.nb_samples = s->frame_len;
- if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
+ frame->nb_samples = s->frame_len;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- if (decode_block(s, (float **)s->frame.extended_data,
+ if (decode_block(s, (float **)frame->extended_data,
avctx->codec->id == AV_CODEC_ID_BINKAUDIO_DCT)) {
av_log(avctx, AV_LOG_ERROR, "Incomplete packet\n");
return AVERROR_INVALIDDATA;
}
get_bits_align32(gb);
- s->frame.nb_samples = s->block_size / avctx->channels;
- *got_frame_ptr = 1;
- *(AVFrame *)data = s->frame;
+ frame->nb_samples = s->block_size / avctx->channels;
+ *got_frame_ptr = 1;
return consumed;
}
OpenPOWER on IntegriCloud