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/qcelpdec.c | |
parent | afe30fe0600824b0dcda8318f09a5a4e376b99c3 (diff) | |
parent | 1b9b6d6e5ea556b6d307f9d473f54f6406fdc3c8 (diff) |
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/qcelpdec.c')
-rw-r--r-- | libavcodec/qcelpdec.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index b8e2290378..76b51f841c 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -53,7 +53,6 @@ typedef enum { } qcelp_packet_rate; typedef struct { - AVFrame avframe; GetBitContext gb; qcelp_packet_rate bitrate; QCELPFrame frame; /**< unpacked data frame */ @@ -97,9 +96,6 @@ static av_cold int qcelp_decode_init(AVCodecContext *avctx) for (i = 0; i < 10; i++) q->prev_lspf[i] = (i + 1) / 11.; - avcodec_get_frame_defaults(&q->avframe); - avctx->coded_frame = &q->avframe; - return 0; } @@ -690,6 +686,7 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; QCELPContext *q = avctx->priv_data; + AVFrame *frame = data; float *outbuffer; int i, ret; float quantized_lspf[10], lpc[10]; @@ -697,12 +694,12 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data, float *formant_mem; /* get output buffer */ - q->avframe.nb_samples = 160; - if ((ret = ff_get_buffer(avctx, &q->avframe)) < 0) { + frame->nb_samples = 160; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - outbuffer = (float *)q->avframe.data[0]; + outbuffer = (float *)frame->data[0]; if ((q->bitrate = determine_bitrate(avctx, buf_size, &buf)) == I_F_Q) { warn_insufficient_frame_quality(avctx, "bitrate cannot be determined."); @@ -785,8 +782,7 @@ erasure: memcpy(q->prev_lspf, quantized_lspf, sizeof(q->prev_lspf)); q->prev_bitrate = q->bitrate; - *got_frame_ptr = 1; - *(AVFrame *)data = q->avframe; + *got_frame_ptr = 1; return buf_size; } |