aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-01-17 13:59:52 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-01-17 13:59:52 +0000
commit175e23e875c53fa2047f61eaad7d8262da67ac9a (patch)
tree8d38829cd60a91604977cec0eb32ce12d92d0a6f
parent8916b4b55b16fe44795aba66ca843c2b5b758fc4 (diff)
downloadffmpeg-175e23e875c53fa2047f61eaad7d8262da67ac9a.tar.gz
Consider initial EOR in the back_ptr calculation.
Originally committed as revision 11550 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/nutenc.c5
-rw-r--r--tests/libav.regression.ref4
-rw-r--r--tests/seek.regression.ref40
3 files changed, 25 insertions, 24 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index a6be630767..8d05377740 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -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);
diff --git a/tests/libav.regression.ref b/tests/libav.regression.ref
index f3a12f51f9..76d5352e03 100644
--- a/tests/libav.regression.ref
+++ b/tests/libav.regression.ref
@@ -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
diff --git a/tests/seek.regression.ref b/tests/seek.regression.ref
index 9c94d20e43..6023f17472 100644
--- a/tests/seek.regression.ref
+++ b/tests/seek.regression.ref
@@ -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
----------------