diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-11-05 18:46:25 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-11-05 18:46:25 +0000 |
commit | aef008b0617cc44d53161104720611d616224982 (patch) | |
tree | b24259250ed564152ab37ec20169546e6da8b3ae | |
parent | 6631e36fa7ad200d1c92be88e9c5579a54288f71 (diff) | |
download | rockbox-aef008b0617cc44d53161104720611d616224982.tar.gz rockbox-aef008b0617cc44d53161104720611d616224982.zip |
Set all track handles to -1 on audio init to avoid calling bufclose(0) on all of them on the first playback stop. This also revealed a bug in audio_release_tracks where it wouldn't release all the tracks because the wrong #define value was used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15484 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/playback.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/playback.c b/apps/playback.c index 422eab9b74..42dbf56fe1 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -2105,7 +2105,7 @@ static bool audio_release_tracks(void) | |||
2105 | 2105 | ||
2106 | logf("releasing all tracks"); | 2106 | logf("releasing all tracks"); |
2107 | 2107 | ||
2108 | for(i = 0; i < MAX_TRACKS; i++) | 2108 | for(i = 0; i < MAX_TRACK; i++) |
2109 | { | 2109 | { |
2110 | cur_idx = (track_ridx + i) & MAX_TRACK_MASK; | 2110 | cur_idx = (track_ridx + i) & MAX_TRACK_MASK; |
2111 | if (!clear_track_info(&tracks[cur_idx])) | 2111 | if (!clear_track_info(&tracks[cur_idx])) |
@@ -3274,6 +3274,14 @@ void audio_init(void) | |||
3274 | /* ...now! Set up the buffers */ | 3274 | /* ...now! Set up the buffers */ |
3275 | audio_reset_buffer(); | 3275 | audio_reset_buffer(); |
3276 | 3276 | ||
3277 | int i; | ||
3278 | for(i = 0; i < MAX_TRACK; i++) | ||
3279 | { | ||
3280 | tracks[i].audio_hid = -1; | ||
3281 | tracks[i].id3_hid = -1; | ||
3282 | tracks[i].codec_hid = -1; | ||
3283 | } | ||
3284 | |||
3277 | /* Probably safe to say */ | 3285 | /* Probably safe to say */ |
3278 | audio_is_initialized = true; | 3286 | audio_is_initialized = true; |
3279 | 3287 | ||