projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
335ee1a
)
Add special case to avoid binary search when appending index entries.
author
Michael Niedermayer
<michaelni@gmx.at>
Tue, 9 Mar 2010 15:19:23 +0000
(15:19 +0000)
committer
Michael Niedermayer
<michaelni@gmx.at>
Tue, 9 Mar 2010 15:19:23 +0000
(15:19 +0000)
Originally committed as revision 22400 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavformat/utils.c
patch
|
blob
|
history
diff --git
a/libavformat/utils.c
b/libavformat/utils.c
index
86bae7b
..
2b579ca
100644
(file)
--- a/
libavformat/utils.c
+++ b/
libavformat/utils.c
@@
-1305,6
+1305,10
@@
int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp,
a = - 1;
b = nb_entries;
+ //optimize appending index entries at the end
+ if(b && entries[b-1].timestamp < wanted_timestamp)
+ a= b-1;
+
while (b - a > 1) {
m = (a + b) >> 1;
timestamp = entries[m].timestamp;