changeset 3564:b016a776ce4b libavformat

Pass AVPacketList instead of the whole context to add_to_pktbuf as that is all that is needed.
author michael
date Sat, 12 Jul 2008 13:15:00 +0000
parents 82f150c809c6
children b3e976d080cd
files utils.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Fri Jul 11 15:12:44 2008 +0000
+++ b/utils.c	Sat Jul 12 13:15:00 2008 +0000
@@ -931,9 +931,9 @@
     return 0;
 }
 
-static AVPacket *add_to_pktbuf(AVFormatContext *s, AVPacket *pkt){
-    AVPacketList *pktl= s->packet_buffer;
-    AVPacketList **plast_pktl= &s->packet_buffer;
+static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt){
+    AVPacketList *pktl;
+    AVPacketList **plast_pktl= packet_buffer;
 
     while(*plast_pktl) plast_pktl= &(*plast_pktl)->next; //FIXME maybe maintain pointer to the last?
 
@@ -991,7 +991,7 @@
                     return ret;
             }
 
-            if(av_dup_packet(add_to_pktbuf(s, pkt)) < 0)
+            if(av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt)) < 0)
                 return AVERROR(ENOMEM);
         }else{
             assert(!s->packet_buffer);
@@ -1984,7 +1984,7 @@
             break;
         }
 
-        pkt= add_to_pktbuf(ic, &pkt1);
+        pkt= add_to_pktbuf(&ic->packet_buffer, &pkt1);
         if(av_dup_packet(pkt) < 0)
             return AVERROR(ENOMEM);