From c90ddd4ec18bfcd0280c2b1fb36a51a924f070c5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 6 Jun 2013 18:16:57 +0200 Subject: 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. --- stream/stream.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'stream') 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", -- cgit v1.2.3