diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:21:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:22:35 +0100 |
commit | 65da7007043cf4fb99b72c7f823cfc15e429b45f (patch) | |
tree | baf5a652e66f919f462cc80c6d8fe0d247788475 /libavcodec/mpc7.c | |
parent | afe30fe0600824b0dcda8318f09a5a4e376b99c3 (diff) | |
parent | 1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8 (diff) | |
download | ffmpeg-65da7007043cf4fb99b72c7f823cfc15e429b45f.tar.gz |
Merge commit '1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8'
* commit '1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8':
qcelp: decode directly to the user-provided AVFrame
pcm-bluray: decode directly to the user-provided AVFrame
nellymoser: decode directly to the user-provided AVFrame
mpc7/8: decode directly to the user-provided AVFrame
mpegaudio: decode directly to the user-provided AVFrame
mlp/truehd: decode directly to the user-provided AVFrame
Conflicts:
libavcodec/mpc7.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpc7.c')
-rw-r--r-- | libavcodec/mpc7.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 8d5955af34..d4f5e2d416 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -95,9 +95,6 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16P; avctx->channel_layout = AV_CH_LAYOUT_STEREO; - avcodec_get_frame_defaults(&c->frame); - avctx->coded_frame = &c->frame; - if(vlc_initialized) return 0; av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); scfi_vlc.table = scfi_table; @@ -197,6 +194,7 @@ static int get_scale_idx(GetBitContext *gb, int ref) static int mpc7_decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { + AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size; MPCContext *c = avctx->priv_data; @@ -226,8 +224,8 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data, buf_size -= 4; /* get output buffer */ - c->frame.nb_samples = MPC_FRAME_SIZE; - if ((ret = ff_get_buffer(avctx, &c->frame)) < 0) { + frame->nb_samples = MPC_FRAME_SIZE; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } @@ -295,9 +293,9 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data, for(ch = 0; ch < 2; ch++) idx_to_quant(c, &gb, bands[i].res[ch], c->Q[ch] + off); - ff_mpc_dequantize_and_synth(c, mb, (int16_t **)c->frame.extended_data, 2); + ff_mpc_dequantize_and_synth(c, mb, (int16_t **)frame->extended_data, 2); if(last_frame) - c->frame.nb_samples = c->lastframelen; + frame->nb_samples = c->lastframelen; bits_used = get_bits_count(&gb); bits_avail = buf_size * 8; @@ -311,8 +309,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data, return avpkt->size; } - *got_frame_ptr = 1; - *(AVFrame *)data = c->frame; + *got_frame_ptr = 1; return avpkt->size; } |