From 363dbc4b58efa0019eb89a28ec4d9f9b463bb74a Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Fri, 14 Apr 2006 22:15:38 +0000 Subject: [PATCH] This might fix the buffering problem. Didn't happen to me the way I usually reproduce it just now git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9668 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/playback.c b/apps/playback.c index 05661198ef..26eec2b9d0 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -24,6 +24,8 @@ * to do on a seek request, if it is a previous track seek, skip previous, * and in the request_next_track callback set the offset up the same way that * starting from an offset works. */ +/* This is also necesary to prevent the problem with buffer overwriting on + * automatic track changes */ #include #include @@ -1761,7 +1763,8 @@ static void initialize_buffer_fill(bool clear_tracks, bool short_fill) else if (!filling_short) { fill_bytesleft = filebuflen - filebufused; - cur_ti->start_pos = ci.curpos; + if (buf_ridx > cur_ti->buf_idx) + cur_ti->start_pos = buf_ridx - cur_ti->buf_idx; } /* Don't initialize if we're already initialized */