diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-13 03:08:56 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-01-13 03:08:56 +0000 |
commit | a1299f067ae71e6e7b96bccd14b414a371252f98 (patch) | |
tree | 4e32ee17f5aaa287ab036d2a68da412ec8a46654 | |
parent | 1e166db2028c0f27ea32d3c9427f993cc24d85ce (diff) | |
download | mpv-a1299f067ae71e6e7b96bccd14b414a371252f98.tar.bz2 mpv-a1299f067ae71e6e7b96bccd14b414a371252f98.tar.xz |
do not discard cache content at seeking type=STREAMTYPE_STREAM
(fixes quicktime streaming at low cache fill)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8939 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/cache2.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libmpdemux/cache2.c b/libmpdemux/cache2.c index d2db6afe6c..be874f88b3 100644 --- a/libmpdemux/cache2.c +++ b/libmpdemux/cache2.c @@ -113,11 +113,16 @@ 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%X \n",read); - s->offset= // FIXME!? - s->min_filepos=s->max_filepos=read; // drop cache content :( - if(s->stream->eof) stream_reset(s->stream); - stream_seek(s->stream,read); - mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%X \n",(int)stream_tell(s->stream)); + // 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->buffer_size) + { + s->offset= // FIXME!? + s->min_filepos=s->max_filepos=read; // drop cache content :( + if(s->stream->eof) stream_reset(s->stream); + stream_seek(s->stream,read); + mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%X \n",(int)stream_tell(s->stream)); + } } // calc number of back-bytes: |