From b1a272eee20cd3ca616432e81ca9adccc8f55e29 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Mon, 3 Jul 2006 21:23:14 +0000 Subject: Patch by Mark Arigo to close bug report #5305 - fixes crashes when attempting to seek beyond the currently buffered data. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10181 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index ecfb93363e..4fc0c33921 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1074,10 +1074,12 @@ static void rebuffer_and_seek(size_t newpos) last_peek_offset = 0; initialize_buffer_fill(true); - if (newpos > AUDIO_REBUFFER_GUESS_SIZE) + if (newpos > AUDIO_REBUFFER_GUESS_SIZE) { + buf_ridx += AUDIO_REBUFFER_GUESS_SIZE; cur_ti->start_pos = newpos - AUDIO_REBUFFER_GUESS_SIZE; - else + } else { cur_ti->start_pos = 0; + } cur_ti->filerem = cur_ti->filesize - cur_ti->start_pos; cur_ti->available = 0; -- cgit v1.2.3