Mercurial > libavcodec.hg
comparison flacdec.c @ 9118:f13d019e004a libavcodec
flacdec: Allocate buffers right after STREAMINFO is parsed.
author | jbr |
---|---|
date | Wed, 04 Mar 2009 00:21:46 +0000 |
parents | cd1e39c1fa42 |
children | f3d87e34599f |
comparison
equal
deleted
inserted
replaced
9117:cfe1aeeb86ed | 9118:f13d019e004a |
---|---|
248 switch (metadata_type) { | 248 switch (metadata_type) { |
249 case FLAC_METADATA_TYPE_STREAMINFO: | 249 case FLAC_METADATA_TYPE_STREAMINFO: |
250 if (!s->got_streaminfo) { | 250 if (!s->got_streaminfo) { |
251 ff_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, | 251 ff_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, |
252 s->gb.buffer+get_bits_count(&s->gb)/8); | 252 s->gb.buffer+get_bits_count(&s->gb)/8); |
253 allocate_buffers(s); | |
253 s->got_streaminfo = 1; | 254 s->got_streaminfo = 1; |
254 } | 255 } |
255 default: | 256 default: |
256 for (i = 0; i < metadata_size; i++) | 257 for (i = 0; i < metadata_size; i++) |
257 skip_bits(&s->gb, 8); | 258 skip_bits(&s->gb, 8); |
258 } | 259 } |
259 } | 260 } |
260 } while (!metadata_last); | 261 } while (!metadata_last); |
261 | 262 |
262 if (s->got_streaminfo) | |
263 allocate_buffers(s); | |
264 return 1; | 263 return 1; |
265 } | 264 } |
266 return 0; | 265 return 0; |
267 } | 266 } |
268 | 267 |