aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/oggenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-09-16 20:04:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-09-16 20:04:04 +0000
commite07b882b4dcdc6fdf807414aebe176a46dd773da (patch)
treeb5753487d7c958983018f346a6b2f75f97ba13a9 /libavformat/oggenc.c
parentd25130eb236ac30698ce1c92f27b3480ba1e0718 (diff)
downloadffmpeg-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.c6
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 {