# HG changeset patch # User michael # Date 1215872907 0 # Node ID 77a07b9dbe989916d4ba6b8172e5e1e205649948 # Parent b3e976d080cdfe07a95c42b48d59c5d96f21bdd4 Move add_to_pktbuf() before av_read_packet(). My future work on codec identification cleanup will need this. diff -r b3e976d080cd -r 77a07b9dbe98 utils.c --- a/utils.c Sat Jul 12 13:25:26 2008 +0000 +++ b/utils.c Sat Jul 12 14:28:27 2008 +0000 @@ -520,6 +520,22 @@ /*******************************************************/ +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? + + pktl = av_mallocz(sizeof(AVPacketList)); + if (!pktl) + return NULL; + + /* add the packet in the buffered packet list */ + *plast_pktl = pktl; + pktl->pkt= *pkt; + return &pktl->pkt; +} + int av_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret; @@ -945,22 +961,6 @@ return 0; } -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? - - pktl = av_mallocz(sizeof(AVPacketList)); - if (!pktl) - return NULL; - - /* add the packet in the buffered packet list */ - *plast_pktl = pktl; - pktl->pkt= *pkt; - return &pktl->pkt; -} - int av_read_frame(AVFormatContext *s, AVPacket *pkt) { AVPacketList *pktl;