diff oggenc.c @ 5210:36d130853c9b libavformat

Improve amortized worst case speed of the muxers packet interleaving code from O(packets_in_the_file) to O(num_of_streams).
author michael
date Wed, 16 Sep 2009 20:04:04 +0000
parents f67fad61077e
children 4292c6f121dc
line wrap: on
line diff
--- a/oggenc.c	Wed Sep 16 18:06:29 2009 +0000
+++ b/oggenc.c	Wed Sep 16 20:04:04 2009 +0000
@@ -261,6 +261,12 @@
             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 {