diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-10-27 19:04:04 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-07 21:46:22 +0200 |
commit | f94717cdc4dfb35ac8dc3b5d593f6e523fdd621e (patch) | |
tree | 596d9111d6cf4f35eddeef339097d06f1ec417a0 /stream/cache2.c | |
parent | c6fb4e2aa2f5a16aaa35411201c600c8ae801c38 (diff) | |
download | mpv-f94717cdc4dfb35ac8dc3b5d593f6e523fdd621e.tar.bz2 mpv-f94717cdc4dfb35ac8dc3b5d593f6e523fdd621e.tar.xz |
cache, stream: avoid extra memcpy when using cache
Add a stream_read_internal() function that reads directly into a given
buffer instead of the stream's internal one. Use this to read directly
into cache memory, avoiding a memcpy(). This requires also adding a
stream_seek_internal() as the normal seek function reads into the
stream's buffer.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32559 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/cache2.c')
-rw-r--r-- | stream/cache2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/cache2.c b/stream/cache2.c index 2b0b8d739d..d7a8005917 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -181,7 +181,7 @@ static int cache_fill(cache_vars_t *s) 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); + stream_seek_internal(s->stream,read); mp_msg(MSGT_CACHE,MSGL_DBG2,"Seek done. new pos: 0x%"PRIX64" \n",(int64_t)stream_tell(s->stream)); } } @@ -223,7 +223,7 @@ static int cache_fill(cache_vars_t *s) s->min_filepos=read-back; // avoid seeking-back to temp area... #endif - len=stream_read(s->stream,&s->buffer[pos],space); + len = stream_read_internal(s->stream, &s->buffer[pos], space); s->eof= !len; s->max_filepos+=len; |