summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:35:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-13 12:35:37 +0100
commit2becf21d9fd841962f87ad4e273274ee81a35bad (patch)
tree69b350cf5d5fc530698b6981442f1af89b221fac /libavcodec/shorten.c
parent08059f6150fcf75d884670cdbdbdf8830fa199bd (diff)
parent4a2b26fc1b1ad123eba473a20e270f2b0ba92bca (diff)
Merge commit '4a2b26fc1b1ad123eba473a20e270f2b0ba92bca'
* commit '4a2b26fc1b1ad123eba473a20e270f2b0ba92bca': tak: decode directly to the user-provided AVFrame smackaud: decode directly to the user-provided AVFrame sipr: decode directly to the user-provided AVFrame shorten: decode directly to the user-provided AVFrame Conflicts: libavcodec/shorten.c libavcodec/takdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 3dda56f766..e993c14b61 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -84,7 +84,6 @@ static const uint8_t is_audio_command[10] = { 1, 1, 1, 1, 0, 0, 0, 1, 1, 0 };
typedef struct ShortenContext {
AVCodecContext *avctx;
- AVFrame frame;
GetBitContext gb;
int min_framesize, max_framesize;
@@ -118,9 +117,6 @@ static av_cold int shorten_decode_init(AVCodecContext * avctx)
ShortenContext *s = avctx->priv_data;
s->avctx = avctx;
- avcodec_get_frame_defaults(&s->frame);
- avctx->coded_frame = &s->frame;
-
return 0;
}
@@ -407,6 +403,7 @@ static int read_header(ShortenContext *s)
static int shorten_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;
ShortenContext *s = avctx->priv_data;
@@ -585,15 +582,15 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
int chan;
/* get output buffer */
- s->frame.nb_samples = s->blocksize;
- if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
+ frame->nb_samples = s->blocksize;
+ if ((ret = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
for (chan = 0; chan < s->channels; chan++) {
- samples_u8 = ((uint8_t **)s->frame.extended_data)[chan];
- samples_s16 = ((int16_t **)s->frame.extended_data)[chan];
+ samples_u8 = ((uint8_t **)frame->extended_data)[chan];
+ samples_s16 = ((int16_t **)frame->extended_data)[chan];
for (i = 0; i < s->blocksize; i++) {
switch (s->internal_ftype) {
case TYPE_U8:
@@ -607,9 +604,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
}
}
-
- *got_frame_ptr = 1;
- *(AVFrame *)data = s->frame;
+ *got_frame_ptr = 1;
}
}
}