提交 40c5e1fa 编写于 作者: M Måns Rullgård

10l: don't allocate a new buffer quite so often

Originally committed as revision 5523 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 12a195e3
...@@ -193,6 +193,7 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial) ...@@ -193,6 +193,7 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial)
os = ogg->streams + idx; os = ogg->streams + idx;
os->serial = serial; os->serial = serial;
os->bufsize = DECODER_BUFFER_SIZE; os->bufsize = DECODER_BUFFER_SIZE;
os->buf = av_malloc(os->bufsize);
os->header = -1; os->header = -1;
st = av_new_stream (s, idx); st = av_new_stream (s, idx);
...@@ -279,7 +280,7 @@ ogg_read_page (AVFormatContext * s, int *str) ...@@ -279,7 +280,7 @@ ogg_read_page (AVFormatContext * s, int *str)
os = ogg->streams + idx; os = ogg->streams + idx;
if(os->segp == os->nsegs) if(os->psize > 0)
ogg_new_buf(ogg, idx); ogg_new_buf(ogg, idx);
if (get_buffer (bc, os->segments, nsegs) < nsegs) if (get_buffer (bc, os->segments, nsegs) < nsegs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册