summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-06-12 07:05:22 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:07:42 +0200
commit93891d0880795e622b4446590f5d091173da8dbc (patch)
tree4415c4701af964fc38e948ec4912e4771a9e6eae
parent74f5659dc2f049cc886ca0f3041dae6d88ca1ad5 (diff)
downloadmpv-93891d0880795e622b4446590f5d091173da8dbc.tar.bz2
mpv-93891d0880795e622b4446590f5d091173da8dbc.tar.xz
cache: Respect -cache-seek-min also for on-disk files
Should reduce issues with mp4/mov (playing those may involve a lot of seeking inside the file). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31371 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--stream/cache2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/stream/cache2.c b/stream/cache2.c
index 05905a6ded..b492a17cd8 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -179,9 +179,11 @@ static int cache_fill(cache_vars_t *s)
if(read<s->min_filepos || read>s->max_filepos){
// seek...
mp_msg(MSGT_CACHE,MSGL_DBG2,"Out of boundaries... seeking to 0x%"PRIX64" \n",(int64_t)read);
- // streaming: drop cache contents only if seeking backward or too much fwd:
- if(s->stream->type!=STREAMTYPE_STREAM ||
- read<s->min_filepos || read>=s->max_filepos+s->seek_limit)
+ // drop cache contents only if seeking backward or too much fwd.
+ // This is also done for on-disk files, since it loses the backseek cache.
+ // That in turn can cause major bandwidth increase and performance
+ // issues with e.g. mov or badly interleaved files
+ if(read<s->min_filepos || read>=s->max_filepos+s->seek_limit)
{
s->offset= // FIXME!?
s->min_filepos=s->max_filepos=read; // drop cache content :(