Michael Niedermayer
0704c44d68
avformat/cache: remove ftruncate usage, its not always available
...
In case of errors the cache file will be slightly larger than needed,
this should have no practical relevance though
Should fix build on VS201*
Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7c210c4424
avformat/cache: Extend cache entries if possible instead of creating new ones
...
This reduces the number of cache entries and should significantly
reduce memory requirements
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
312151bb9a
avformat/cache: avoid lseek() on reading from the cache if possible
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ce3551896a
avformat/cache: keep cache_pos updated
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
954fc854f2
avformat/cache: cleanup cache file on cache write failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
8706910c4c
avformat/cache: Support user specified read-ahead for non seekable media
...
Fixes Ticket2406
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7018d3d351
avformat/cache: Use the correct io handle in seeking
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
dedd3c89ae
avformat/cache: more informative error message
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
681559d3ff
avformat/cache: remember EOF point if hit and use it to handle SEEK_END
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0c0168a210
avformat/cache: support non continuous caching
...
This allows using the cache protocol on top of seekable but slow protocols to
speed them up
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
eb19d89d8e
cache: check lseek() return
...
Fixes CID717496
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Derek Buitenhuis
af2a17c09a
cache: Only include unistd.h if it exists
...
This follows suite from f3be359707
.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
e81e0b9991
cache: fix "warning: passing argument 2 of ‘av_tempfile’ from incompatible pointer type"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Jean First
576ada791a
cache: use av_freep instead of av_free in cache_open
...
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Jean First
3ceb4c907e
cache: remove unused variable in cache_open
...
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
74dbb5388e
av_tempfile: Pass int log_offset, void *log_ctx
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
9329d36a3a
cache: add todo list
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
02b651a7e3
cache: Fallback to using the cache size for AVSEEK_SIZE if the underlaying protocol has nothing better.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e9f62a8b2b
add cache protocol
...
This allows backward seeking on top of some non seekable streams.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago