diff options
author | wm4 <wm4@nowhere> | 2013-06-06 18:16:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-16 22:05:10 +0200 |
commit | c90ddd4ec18bfcd0280c2b1fb36a51a924f070c5 (patch) | |
tree | 04b2e07f6667f183b37606b04fbe1a0ffe600fef | |
parent | df09c1aa63b442d41ddd1b57245da1c62ffca514 (diff) | |
download | mpv-c90ddd4ec18bfcd0280c2b1fb36a51a924f070c5.tar.bz2 mpv-c90ddd4ec18bfcd0280c2b1fb36a51a924f070c5.tar.xz |
stream: don't align stream position if not needed
This is pointless, and just increases latency on seeking. For streams
that have a sector size set, this is still needed, though.
-rw-r--r-- | stream/stream.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/stream/stream.c b/stream/stream.c index ddebc6da74..a811ec59e0 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -530,7 +530,6 @@ static int stream_seek_unbuffered(stream_t *s, int64_t newpos) // Unlike stream_seek_unbuffered(), it still fills the local buffer. static int stream_seek_long(stream_t *s, int64_t pos) { - int64_t newpos = 0; int64_t oldpos = s->pos; s->buf_pos = s->buf_len = 0; s->eof = 0; @@ -541,10 +540,9 @@ static int stream_seek_long(stream_t *s, int64_t pos) return 1; } + int64_t newpos = pos; if (s->sector_size) newpos = (pos / s->sector_size) * s->sector_size; - else - newpos = pos & (~((int64_t)STREAM_BUFFER_SIZE - 1)); mp_msg(MSGT_STREAM, MSGL_DBG3, "s->pos=%" PRIX64 " newpos=%" PRIX64 " new_bufpos=%" PRIX64 " buflen=%X \n", |