diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:28:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-13 12:28:27 +0100 |
commit | 08059f6150fcf75d884670cdbdbdf8830fa199bd (patch) | |
tree | 3e3c42784e6b34b0de16fa3fad2fbd852f59137c /libavcodec/qdm2.c | |
parent | 65da7007043cf4fb99b72c7f823cfc15e429b45f (diff) | |
parent | 5d5c248c3df30fa91a8dde639618c985b9a11c53 (diff) | |
download | ffmpeg-08059f6150fcf75d884670cdbdbdf8830fa199bd.tar.gz |
Merge commit '5d5c248c3df30fa91a8dde639618c985b9a11c53'
* commit '5d5c248c3df30fa91a8dde639618c985b9a11c53':
s302m: decode directly to the user-provided AVFrame
ra288: decode directly to the user-provided AVFrame
ra144: decode directly to the user-provided AVFrame
ralf: decode directly to the user-provided AVFrame
qdm2: decode directly to the user-provided AVFrame
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/qdm2.c')
-rw-r--r-- | libavcodec/qdm2.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 4deea07baf..387a3c6a3b 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -130,8 +130,6 @@ typedef struct { * QDM2 decoder context */ typedef struct { - AVFrame frame; - /// Parameters from codec header, do not change during playback int nb_channels; ///< number of channels int channels; ///< number of channels @@ -1879,9 +1877,6 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) avctx->sample_fmt = AV_SAMPLE_FMT_S16; - avcodec_get_frame_defaults(&s->frame); - avctx->coded_frame = &s->frame; - return 0; } @@ -1962,6 +1957,7 @@ static int qdm2_decode (QDM2Context *q, const uint8_t *in, int16_t *out) static int qdm2_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; QDM2Context *s = avctx->priv_data; @@ -1974,12 +1970,12 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data, return -1; /* get output buffer */ - s->frame.nb_samples = 16 * s->frame_size; - if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) { + frame->nb_samples = 16 * s->frame_size; + if ((ret = ff_get_buffer(avctx, frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - out = (int16_t *)s->frame.data[0]; + out = (int16_t *)frame->data[0]; for (i = 0; i < 16; i++) { if (qdm2_decode(s, buf, out) < 0) @@ -1987,8 +1983,7 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data, out += s->channels * s->frame_size; } - *got_frame_ptr = 1; - *(AVFrame *)data = s->frame; + *got_frame_ptr = 1; return s->checksum_size; } |