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>
This commit is contained in:
Michael Niedermayer
2013-02-13 12:21:00 +01:00
8 changed files with 52 additions and 90 deletions

View File

@@ -144,9 +144,6 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
avctx->channel_layout = (channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
avctx->channels = channels;
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");
@@ -244,6 +241,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
static int mpc8_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;
MPCContext *c = avctx->priv_data;
@@ -255,8 +253,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
int last[2];
/* get output buffer */
c->frame.nb_samples = MPC_FRAME_SIZE;
if ((res = ff_get_buffer(avctx, &c->frame)) < 0) {
frame->nb_samples = MPC_FRAME_SIZE;
if ((res = ff_get_buffer(avctx, frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res;
}
@@ -415,7 +413,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
}
ff_mpc_dequantize_and_synth(c, maxband - 1,
(int16_t **)c->frame.extended_data,
(int16_t **)frame->extended_data,
avctx->channels);
c->cur_frame++;
@@ -426,8 +424,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
if(c->cur_frame >= c->frames)
c->cur_frame = 0;
*got_frame_ptr = 1;
*(AVFrame *)data = c->frame;
*got_frame_ptr = 1;
return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
}