Consider initial EOR in the back_ptr calculation.

Originally committed as revision 11550 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2008-01-17 13:59:52 +00:00
parent 8916b4b55b
commit 175e23e875
3 changed files with 25 additions and 24 deletions

View File

@ -476,9 +476,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){
for(i=0; i<s->nb_streams; i++){
AVStream *st= s->streams[i];
int index= av_index_search_timestamp(st, pkt->dts, AVSEEK_FLAG_BACKWARD);
if(index<0) dummy.pos=0;
else dummy.pos= FFMIN(dummy.pos, st->index_entries[index].pos);
if(index>=0) dummy.pos= FFMIN(dummy.pos, st->index_entries[index].pos);
}
if(dummy.pos == INT64_MAX)
dummy.pos= 0;
sp= av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp, NULL);
nut->last_syncpoint_pos= url_ftell(bc);

View File

@ -31,8 +31,8 @@ f8ad5bd78f4d012a8ce9570aa395ac54 *./tests/data/b-libav.flv
2ba41cf880aa5cb87e8a08fdb735398d *./tests/data/b-libav.gxf
814640 ./tests/data/b-libav.gxf
./tests/data/b-libav.gxf CRC=0xa376c09e
1df60f0160da3aa6502e886591ca95c0 *./tests/data/b-libav.nut
331017 ./tests/data/b-libav.nut
b54fe5ee2983506550b4433b63845daf *./tests/data/b-libav.nut
331018 ./tests/data/b-libav.nut
./tests/data/b-libav.nut CRC=0x400c29e9
43238b15f1012aa27536c2be20bb2383 *./tests/data/b-libav.mkv
329854 ./tests/data/b-libav.mkv

View File

@ -3127,55 +3127,55 @@ ret: 0 st: 1 dts:0.500000 pts:0.500000 pos:-1 size:208 flags:1
tests/data/b-libav.nut
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st:-1 ts:-1.000000 flags:0
ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28361 size:208 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st:-1 ts:1.894167 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 0 ts:0.800000 flags:0
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149740 size:27412 flags:1
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149741 size:27412 flags:1
ret: 0 st: 0 ts:-0.320000 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st: 1 ts:2.586122 flags:0
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 1 ts:1.462857 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st:-1 ts:0.365002 flags:0
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st:-1 ts:-0.740831 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st: 0 ts:2.160000 flags:0
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 0 ts:1.040000 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 1 ts:-0.052245 flags:0
ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28361 size:208 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st: 1 ts:2.847347 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st:-1 ts:1.730004 flags:0
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st:-1 ts:0.624171 flags:1
ret: 0 st: 1 dts:0.417959 pts:0.417959 pos:138863 size:209 flags:1
ret: 0 st: 1 dts:0.417959 pts:0.417959 pos:138864 size:209 flags:1
ret: 0 st: 0 ts:-0.480000 flags:0
ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28361 size:208 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st: 0 ts:2.400000 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 1 ts:1.306122 flags:0
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 1 ts:0.208980 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st:-1 ts:-0.904994 flags:0
ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28361 size:208 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st:-1 ts:1.989173 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 0 ts:0.880000 flags:0
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149740 size:27412 flags:1
ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149741 size:27412 flags:1
ret: 0 st: 0 ts:-0.240000 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
ret: 0 st: 1 ts:2.664490 flags:0
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st: 1 ts:1.567347 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302254 size:27897 flags:1
ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:302255 size:27897 flags:1
ret: 0 st:-1 ts:0.460008 flags:0
ret: 0 st: 1 dts:0.470204 pts:0.470204 pos:149505 size:209 flags:1
ret: 0 st: 1 dts:0.470204 pts:0.470204 pos:149506 size:209 flags:1
ret: 0 st:-1 ts:-0.645825 flags:1
ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:248 size:28088 flags:1
----------------