Mercurial > libavformat.hg
comparison utils.c @ 2400:fcaecfb05781 libavformat
When looking for the last packet in each
stream, so as to calculate the duration, don't stop
as soon as all streams have seen at least one packet.
Otherwise the duration will be shorter than it
should be. We must keep reading to the end-of-file.
patch by neilb suse de
| author | michael |
|---|---|
| date | Sat, 18 Aug 2007 00:52:05 +0000 |
| parents | e1fdab28da80 |
| children | c356a88cedf6 |
comparison
equal
deleted
inserted
replaced
| 2399:e1fdab28da80 | 2400:fcaecfb05781 |
|---|---|
| 1535 url_fseek(&ic->pb, offset, SEEK_SET); | 1535 url_fseek(&ic->pb, offset, SEEK_SET); |
| 1536 read_size = 0; | 1536 read_size = 0; |
| 1537 for(;;) { | 1537 for(;;) { |
| 1538 if (read_size >= DURATION_MAX_READ_SIZE) | 1538 if (read_size >= DURATION_MAX_READ_SIZE) |
| 1539 break; | 1539 break; |
| 1540 /* if all info is available, we can stop */ | |
| 1541 for(i = 0;i < ic->nb_streams; i++) { | |
| 1542 st = ic->streams[i]; | |
| 1543 if (st->duration == AV_NOPTS_VALUE) | |
| 1544 break; | |
| 1545 } | |
| 1546 if (i == ic->nb_streams) | |
| 1547 break; | |
| 1548 | 1540 |
| 1549 ret = av_read_packet(ic, pkt); | 1541 ret = av_read_packet(ic, pkt); |
| 1550 if (ret != 0) | 1542 if (ret != 0) |
| 1551 break; | 1543 break; |
| 1552 read_size += pkt->size; | 1544 read_size += pkt->size; |
