diff options
author | Måns Rullgård <mans@mansr.com> | 2006-06-25 12:23:54 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2006-06-25 12:23:54 +0000 |
commit | 40c5e1fa2e5fd668ed69528d91521b46ec64f96a (patch) | |
tree | 7e96baafc71aa40bf592d878922e3b3fa922fb19 | |
parent | 12a195e32fa36fd2d2b0d16f7d96f1d8651665b8 (diff) | |
download | ffmpeg-40c5e1fa2e5fd668ed69528d91521b46ec64f96a.tar.gz |
10l: don't allocate a new buffer quite so often
Originally committed as revision 5523 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/ogg2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/ogg2.c b/libavformat/ogg2.c index 9cb3d8ca62..b29bfe9cab 100644 --- a/libavformat/ogg2.c +++ b/libavformat/ogg2.c @@ -193,6 +193,7 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial) os = ogg->streams + idx; os->serial = serial; os->bufsize = DECODER_BUFFER_SIZE; + os->buf = av_malloc(os->bufsize); os->header = -1; st = av_new_stream (s, idx); @@ -279,7 +280,7 @@ ogg_read_page (AVFormatContext * s, int *str) os = ogg->streams + idx; - if(os->segp == os->nsegs) + if(os->psize > 0) ogg_new_buf(ogg, idx); if (get_buffer (bc, os->segments, nsegs) < nsegs) |