diff options
author | Andreas Öman <andreas@lonelycoder.com> | 2009-01-23 12:09:32 +0000 |
---|---|---|
committer | Andreas Öman <andreas@lonelycoder.com> | 2009-01-23 12:09:32 +0000 |
commit | cf92cec7d8899ef887869628c66da30737ee54af (patch) | |
tree | b3bb20c478aad380efa29fc33b2980bf3e04a36c /libavcodec/mpegaudio_parser.c | |
parent | 2d4eeaadc41a0adf97d6b71677d014833df432e2 (diff) | |
download | ffmpeg-cf92cec7d8899ef887869628c66da30737ee54af.tar.gz |
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
Diffstat (limited to 'libavcodec/mpegaudio_parser.c')
-rw-r--r-- | libavcodec/mpegaudio_parser.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index b06b15a56d..646da8b67d 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -46,8 +46,7 @@ typedef struct MpegAudioParseContext { header, otherwise the coded frame size in bytes */ int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate) { - MPADecodeContext s1, *s = &s1; - s1.avctx = avctx; + MPADecodeHeader s1, *s = &s1; if (ff_mpa_check_header(head) != 0) return -1; @@ -145,7 +144,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, #if 0 /* free format: prepare to compute frame size */ - if (ff_mpegaudio_decode_header(s, header) == 1) { + if (ff_mpegaudio_decode_header((MPADecodeHeader *)s, header) == 1) { s->frame_size = -1; } #endif @@ -200,7 +199,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, s->free_format_frame_size -= padding; dprintf(avctx, "free frame size=%d padding=%d\n", s->free_format_frame_size, padding); - ff_mpegaudio_decode_header(s, header1); + ff_mpegaudio_decode_header((MPADecodeHeader *)s, header1); goto next_data; } p++; |