aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cook.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:53:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 11:53:23 +0100
commit0a5138695aa441ab341b2f00d946c239db69edbf (patch)
tree900049ab4690d9511ae2ccad787e0000694529cb /libavcodec/cook.c
parentf03cdbd0454fbdba53a123a8f95186a519fade8d (diff)
parent182821cff43f5f977004d105b86c47ceb20d00d6 (diff)
downloadffmpeg-0a5138695aa441ab341b2f00d946c239db69edbf.tar.gz
Merge commit '182821cff43f5f977004d105b86c47ceb20d00d6'
* commit '182821cff43f5f977004d105b86c47ceb20d00d6': dca: decode directly to the user-provided AVFrame cook: decode directly to the user-provided AVFrame comfortnoise: decode directly to the user-provided AVFrame bmvaudio: decode directly to the user-provided AVFrame pcm: decode directly to the user-provided AVFrame Conflicts: libavcodec/pcm.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 4117cee1f9..54b576f89f 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -123,7 +123,6 @@ typedef struct cook {
AVCodecContext* avctx;
DSPContext dsp;
- AVFrame frame;
GetBitContext gb;
/* stream data */
int num_vectors;
@@ -956,6 +955,7 @@ static int decode_subpacket(COOKContext *q, COOKSubpacket *p,
static int cook_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
+ AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
COOKContext *q = avctx->priv_data;
@@ -969,12 +969,12 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
/* get output buffer */
if (q->discarded_packets >= 2) {
- q->frame.nb_samples = q->samples_per_channel;
- if ((ret = ff_get_buffer(avctx, &q->frame)) < 0) {
+ frame->nb_samples = q->samples_per_channel;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
- samples = (float **)q->frame.extended_data;
+ samples = (float **)frame->extended_data;
}
/* estimate subpacket sizes */
@@ -1015,8 +1015,7 @@ static int cook_decode_frame(AVCodecContext *avctx, void *data,
return avctx->block_align;
}
- *got_frame_ptr = 1;
- *(AVFrame *) data = q->frame;
+ *got_frame_ptr = 1;
return avctx->block_align;
}
@@ -1269,9 +1268,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
else
avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
- avcodec_get_frame_defaults(&q->frame);
- avctx->coded_frame = &q->frame;
-
#ifdef DEBUG
dump_cook_context(q);
#endif