OSDN Git Service

set last packet next pointer to null
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Thu, 12 Feb 2009 05:32:40 +0000 (05:32 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Thu, 12 Feb 2009 05:32:40 +0000 (05:32 +0000)
Originally committed as revision 17176 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mxfenc.c

index d60ffce..833f53a 100644 (file)
@@ -1560,6 +1560,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
         pktl = s->packet_buffer;
         if (s->nb_streams != stream_count) {
             AVPacketList *first = NULL;
+            AVPacketList *last = NULL;
             // find first packet in edit unit
             while (pktl) {
                 AVStream *st = s->streams[pktl->pkt.stream_index];
@@ -1567,8 +1568,11 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
                     break;
                 else if (!first)
                     first = pktl;
+                last = pktl;
                 pktl = pktl->next;
             }
+            if (last)
+                last->next = NULL;
             // purge packet queue
             while (pktl) {
                 AVPacketList *next = pktl->next;