Avoid allocating MPADecodeContext on stack.

Instead move relevant fields into MPADecodeHeader and use it
where appropriate.

Originally committed as revision 16728 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Andreas Öman
2009-01-23 12:09:32 +00:00
parent 2d4eeaadc4
commit cf92cec7d8
6 changed files with 26 additions and 20 deletions

View File

@@ -2277,7 +2277,7 @@ retry:
goto retry;
}
if (ff_mpegaudio_decode_header(s, header) == 1) {
if (ff_mpegaudio_decode_header((MPADecodeHeader *)s, header) == 1) {
/* free format: prepare to compute frame size */
s->frame_size = -1;
return -1;
@@ -2342,7 +2342,7 @@ static int decode_frame_adu(AVCodecContext * avctx,
return buf_size;
}
ff_mpegaudio_decode_header(s, header);
ff_mpegaudio_decode_header((MPADecodeHeader *)s, header);
/* update codec info */
avctx->sample_rate = s->sample_rate;
avctx->channels = s->nb_channels;
@@ -2491,7 +2491,7 @@ static int decode_frame_mp3on4(AVCodecContext * avctx,
if (ff_mpa_check_header(header) < 0) // Bad header, discard block
break;
ff_mpegaudio_decode_header(m, header);
ff_mpegaudio_decode_header((MPADecodeHeader *)m, header);
out_size += mp_decode_frame(m, outptr, buf, fsize);
buf += fsize;
len -= fsize;