diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 11:18:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 11:27:54 +0100 |
commit | 4789955ec4260f9e8f99b8d774ada2ad679d5630 (patch) | |
tree | b94dfe29f21daf81a3fe5d759e093c26de7be7e3 /libavcodec/8svx.c | |
parent | 2acd5fb5532587507ab197788338ae55bf9128aa (diff) | |
parent | e57daa876bf0cf50782550e366e589441cd8c2bd (diff) | |
download | ffmpeg-4789955ec4260f9e8f99b8d774ada2ad679d5630.tar.gz |
Merge commit 'e57daa876bf0cf50782550e366e589441cd8c2bd'
* commit 'e57daa876bf0cf50782550e366e589441cd8c2bd':
adpcm: decode directly to the user-provided AVFrame
ac3: decode directly to the user-provided AVFrame
aac: decode directly to the user-provided AVFrame
8svx: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/8svx.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/8svx.c')
-rw-r--r-- | libavcodec/8svx.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 4bbbeb139f..d33f73e039 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -44,7 +44,6 @@ /** decoder context */ typedef struct EightSvxContext { - AVFrame frame; uint8_t fib_acc[2]; const int8_t *table; @@ -88,6 +87,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { EightSvxContext *esc = avctx->priv_data; + AVFrame *frame = data; int buf_size; int ch, ret; int hdr_size = 2; @@ -135,21 +135,20 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, } /* get output buffer */ - esc->frame.nb_samples = buf_size * 2; - if ((ret = ff_get_buffer(avctx, &esc->frame)) < 0) { + frame->nb_samples = buf_size * 2; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } for (ch = 0; ch < avctx->channels; ch++) { - delta_decode(esc->frame.data[ch], &esc->data[ch][esc->data_idx], + delta_decode(frame->data[ch], &esc->data[ch][esc->data_idx], buf_size, &esc->fib_acc[ch], esc->table); } esc->data_idx += buf_size; - *got_frame_ptr = 1; - *(AVFrame *)data = esc->frame; + *got_frame_ptr = 1; return ((avctx->frame_number == 0)*hdr_size + buf_size)*avctx->channels; } @@ -172,9 +171,6 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx) } avctx->sample_fmt = AV_SAMPLE_FMT_U8P; - avcodec_get_frame_defaults(&esc->frame); - avctx->coded_frame = &esc->frame; - return 0; } |