diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-09-16 20:04:04 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-09-16 20:04:04 +0000 |
commit | e07b882b4dcdc6fdf807414aebe176a46dd773da (patch) | |
tree | b5753487d7c958983018f346a6b2f75f97ba13a9 /libavformat/oggenc.c | |
parent | d25130eb236ac30698ce1c92f27b3480ba1e0718 (diff) | |
download | ffmpeg-e07b882b4dcdc6fdf807414aebe176a46dd773da.tar.gz |
Improve amortized worst case speed of the muxers packet interleaving code
from O(packets_in_the_file) to O(num_of_streams).
Originally committed as revision 19887 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/oggenc.c')
-rw-r--r-- | libavformat/oggenc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 2bd8e0d49f..9ab1ac0aff 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -261,6 +261,12 @@ static int ogg_interleave_per_granule(AVFormatContext *s, AVPacket *out, AVPacke OGGStreamContext *ogg = s->streams[out->stream_index]->priv_data; ogg->eos = 1; } + if(!s->packet_buffer) + s->packet_buffer_end= NULL; + + if(s->streams[out->stream_index]->last_in_packet_buffer == pktl) + s->streams[out->stream_index]->last_in_packet_buffer= NULL; + av_freep(&pktl); return 1; } else { |