diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-07-29 19:34:12 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-07-29 19:34:12 +0000 |
commit | 4ccacd4004ff38cd0298d8c59296f90585bfb2d3 (patch) | |
tree | 23516c655d3a9e9c21f8e3030c34a1748688b44a /apps | |
parent | 3b2f049ec61fc85adfe37e38698e030852e14aed (diff) |
Completely remove all track entries at audio_rebuffer().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10364 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/playback.c b/apps/playback.c index 9c8f89127c..aa4471ab33 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -925,20 +925,24 @@ static void audio_rebuffer(void) queue_post(&codec_callback_queue, Q_CODEC_REQUEST_PENDING, 0); /* Stop in progress fill, and clear open file descriptor */ - close(current_fd); - current_fd = -1; + if (current_fd >= 0) + { + close(current_fd); + current_fd = -1; + } filling = false; /* Reset buffer and track pointers */ buf_ridx = buf_widx = 0; - track_widx = track_ridx = 0; - audio_clear_track_entries(false, true); + track_widx = track_ridx; + audio_clear_track_entries(true, true); filebufused = 0; /* Fill the buffer */ last_peek_offset = -1; cur_ti->filesize = 0; cur_ti->start_pos = 0; + ci.curpos = 0; if (!cur_ti->taginfo_ready) memset(&cur_ti->id3, 0, sizeof(struct mp3entry)); @@ -2124,7 +2128,8 @@ static void track_skip_done(bool was_manual) } } -static bool load_next_track(void) { +static bool load_next_track(void) +{ struct event ev; if (ci.seek_time) @@ -2144,7 +2149,8 @@ static bool load_next_track(void) { cpu_boost(true); queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); - while (1) { + while (1) + { queue_wait(&codec_callback_queue, &ev); if (ev.id == Q_CODEC_REQUEST_PENDING) { |