From 40c5e1fa2e5fd668ed69528d91521b46ec64f96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Sun, 25 Jun 2006 12:23:54 +0000 Subject: [PATCH] 10l: don't allocate a new buffer quite so often Originally committed as revision 5523 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/ogg2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)