Mercurial > libavformat.hg
comparison utils.c @ 804:6a0cd265adbb libavformat
fix assertion failure
| author | michael |
|---|---|
| date | Wed, 29 Jun 2005 08:48:26 +0000 |
| parents | ea0e995ac4a8 |
| children | bae563a91a57 |
comparison
equal
deleted
inserted
replaced
| 803:021c8bf015c2 | 804:6a0cd265adbb |
|---|---|
| 2284 return ret; | 2284 return ret; |
| 2285 } | 2285 } |
| 2286 | 2286 |
| 2287 /** | 2287 /** |
| 2288 * interleave_packet implementation which will interleave per DTS. | 2288 * interleave_packet implementation which will interleave per DTS. |
| 2289 * packets with pkt->destruct == av_destruct_packet will be freed inside this function. | |
| 2290 * so they cannot be used after it, note calling av_free_packet() on them is still safe | |
| 2289 */ | 2291 */ |
| 2290 static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){ | 2292 static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){ |
| 2291 AVPacketList *pktl, **next_point, *this_pktl; | 2293 AVPacketList *pktl, **next_point, *this_pktl; |
| 2292 int stream_count=0; | 2294 int stream_count=0; |
| 2293 int streams[MAX_STREAMS]; | 2295 int streams[MAX_STREAMS]; |
| 2294 | 2296 |
| 2295 if(pkt){ | 2297 if(pkt){ |
| 2296 AVStream *st= s->streams[ pkt->stream_index]; | 2298 AVStream *st= s->streams[ pkt->stream_index]; |
| 2297 | 2299 |
| 2298 assert(pkt->destruct != av_destruct_packet); //FIXME | 2300 // assert(pkt->destruct != av_destruct_packet); //FIXME |
| 2299 | 2301 |
| 2300 this_pktl = av_mallocz(sizeof(AVPacketList)); | 2302 this_pktl = av_mallocz(sizeof(AVPacketList)); |
| 2301 this_pktl->pkt= *pkt; | 2303 this_pktl->pkt= *pkt; |
| 2302 av_dup_packet(&this_pktl->pkt); | 2304 if(pkt->destruct == av_destruct_packet) |
| 2305 pkt->destruct= NULL; // non shared -> must keep original from being freed | |
| 2306 else | |
| 2307 av_dup_packet(&this_pktl->pkt); //shared -> must dup | |
| 2303 | 2308 |
| 2304 next_point = &s->packet_buffer; | 2309 next_point = &s->packet_buffer; |
| 2305 while(*next_point){ | 2310 while(*next_point){ |
| 2306 AVStream *st2= s->streams[ (*next_point)->pkt.stream_index]; | 2311 AVStream *st2= s->streams[ (*next_point)->pkt.stream_index]; |
| 2307 int64_t left= st2->time_base.num * (int64_t)st ->time_base.den; | 2312 int64_t left= st2->time_base.num * (int64_t)st ->time_base.den; |
