# HG changeset patch # User michael # Date 1120034906 0 # Node ID 6a0cd265adbb4524078ae57ee3c818e41c33a14f # Parent 021c8bf015c25da527eb6fc081f2ace5fa64480c fix assertion failure diff -r 021c8bf015c2 -r 6a0cd265adbb utils.c --- a/utils.c Tue Jun 28 14:51:56 2005 +0000 +++ b/utils.c Wed Jun 29 08:48:26 2005 +0000 @@ -2286,6 +2286,8 @@ /** * interleave_packet implementation which will interleave per DTS. + * packets with pkt->destruct == av_destruct_packet will be freed inside this function. + * so they cannot be used after it, note calling av_free_packet() on them is still safe */ static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){ AVPacketList *pktl, **next_point, *this_pktl; @@ -2295,11 +2297,14 @@ if(pkt){ AVStream *st= s->streams[ pkt->stream_index]; - assert(pkt->destruct != av_destruct_packet); //FIXME +// assert(pkt->destruct != av_destruct_packet); //FIXME this_pktl = av_mallocz(sizeof(AVPacketList)); this_pktl->pkt= *pkt; - av_dup_packet(&this_pktl->pkt); + if(pkt->destruct == av_destruct_packet) + pkt->destruct= NULL; // non shared -> must keep original from being freed + else + av_dup_packet(&this_pktl->pkt); //shared -> must dup next_point = &s->packet_buffer; while(*next_point){