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 | |
parent | 3b2f049ec61fc85adfe37e38698e030852e14aed (diff) | |
download | rockbox-4ccacd4004ff38cd0298d8c59296f90585bfb2d3.tar.gz rockbox-4ccacd4004ff38cd0298d8c59296f90585bfb2d3.zip |
Completely remove all track entries at audio_rebuffer().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10364 a1c6a512-1295-4272-9138-f99709370657
-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) | |||
925 | queue_post(&codec_callback_queue, Q_CODEC_REQUEST_PENDING, 0); | 925 | queue_post(&codec_callback_queue, Q_CODEC_REQUEST_PENDING, 0); |
926 | 926 | ||
927 | /* Stop in progress fill, and clear open file descriptor */ | 927 | /* Stop in progress fill, and clear open file descriptor */ |
928 | close(current_fd); | 928 | if (current_fd >= 0) |
929 | current_fd = -1; | 929 | { |
930 | close(current_fd); | ||
931 | current_fd = -1; | ||
932 | } | ||
930 | filling = false; | 933 | filling = false; |
931 | 934 | ||
932 | /* Reset buffer and track pointers */ | 935 | /* Reset buffer and track pointers */ |
933 | buf_ridx = buf_widx = 0; | 936 | buf_ridx = buf_widx = 0; |
934 | track_widx = track_ridx = 0; | 937 | track_widx = track_ridx; |
935 | audio_clear_track_entries(false, true); | 938 | audio_clear_track_entries(true, true); |
936 | filebufused = 0; | 939 | filebufused = 0; |
937 | 940 | ||
938 | /* Fill the buffer */ | 941 | /* Fill the buffer */ |
939 | last_peek_offset = -1; | 942 | last_peek_offset = -1; |
940 | cur_ti->filesize = 0; | 943 | cur_ti->filesize = 0; |
941 | cur_ti->start_pos = 0; | 944 | cur_ti->start_pos = 0; |
945 | ci.curpos = 0; | ||
942 | 946 | ||
943 | if (!cur_ti->taginfo_ready) | 947 | if (!cur_ti->taginfo_ready) |
944 | memset(&cur_ti->id3, 0, sizeof(struct mp3entry)); | 948 | memset(&cur_ti->id3, 0, sizeof(struct mp3entry)); |
@@ -2124,7 +2128,8 @@ static void track_skip_done(bool was_manual) | |||
2124 | } | 2128 | } |
2125 | } | 2129 | } |
2126 | 2130 | ||
2127 | static bool load_next_track(void) { | 2131 | static bool load_next_track(void) |
2132 | { | ||
2128 | struct event ev; | 2133 | struct event ev; |
2129 | 2134 | ||
2130 | if (ci.seek_time) | 2135 | if (ci.seek_time) |
@@ -2144,7 +2149,8 @@ static bool load_next_track(void) { | |||
2144 | 2149 | ||
2145 | cpu_boost(true); | 2150 | cpu_boost(true); |
2146 | queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); | 2151 | queue_post(&audio_queue, Q_AUDIO_CHECK_NEW_TRACK, 0); |
2147 | while (1) { | 2152 | while (1) |
2153 | { | ||
2148 | queue_wait(&codec_callback_queue, &ev); | 2154 | queue_wait(&codec_callback_queue, &ev); |
2149 | if (ev.id == Q_CODEC_REQUEST_PENDING) | 2155 | if (ev.id == Q_CODEC_REQUEST_PENDING) |
2150 | { | 2156 | { |