diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2006-07-05 23:33:20 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2006-07-05 23:33:20 +0000 |
commit | b44714331b2354b08eddb7e6c47c0b05ce9b0243 (patch) | |
tree | 1f6ceafd8ba8cf83731031285c8d39a37b520062 /apps/tree.c | |
parent | 8436d41b38045682c0c7377b2f0155f69a12862e (diff) | |
download | rockbox-b44714331b2354b08eddb7e6c47c0b05ce9b0243.tar.gz rockbox-b44714331b2354b08eddb7e6c47c0b05ce9b0243.zip |
Fix an occasional crash when using .talk MP3 files for directories in ID3 browsing mode. Spotted and fixed by Steve Bavin (plus minor change by me)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10185 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/tree.c b/apps/tree.c index e5f4151891..e2541c257c 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -835,7 +835,7 @@ static bool dirbrowse(void) | |||
835 | if (attr & ATTR_DIRECTORY) | 835 | if (attr & ATTR_DIRECTORY) |
836 | { | 836 | { |
837 | DEBUGF("Playing directory thumbnail: %s", currdir); | 837 | DEBUGF("Playing directory thumbnail: %s", currdir); |
838 | res = ft_play_dirname(lasti); | 838 | res = ft_play_dirname(name); |
839 | if (res < 0) /* failed, not existing */ | 839 | if (res < 0) /* failed, not existing */ |
840 | { /* say the number instead, as a fallback */ | 840 | { /* say the number instead, as a fallback */ |
841 | talk_id(VOICE_DIR, false); | 841 | talk_id(VOICE_DIR, false); |
@@ -1298,17 +1298,16 @@ int ft_play_filenumber(int pos, int attr) | |||
1298 | return 1; | 1298 | return 1; |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | int ft_play_dirname(int start_index) | 1301 | int ft_play_dirname(char* name) |
1302 | { | 1302 | { |
1303 | int fd; | 1303 | int fd; |
1304 | char dirname_mp3_filename[MAX_PATH+1]; | 1304 | char dirname_mp3_filename[MAX_PATH+1]; |
1305 | struct entry *dircache = tc.dircache; | ||
1306 | 1305 | ||
1307 | if (audio_status() & AUDIO_STATUS_PLAY) | 1306 | if (audio_status() & AUDIO_STATUS_PLAY) |
1308 | return 0; | 1307 | return 0; |
1309 | 1308 | ||
1310 | snprintf(dirname_mp3_filename, sizeof(dirname_mp3_filename), "%s/%s/%s", | 1309 | snprintf(dirname_mp3_filename, sizeof(dirname_mp3_filename), "%s/%s/%s", |
1311 | tc.currdir[1] ? tc.currdir : "" , dircache[start_index].name, | 1310 | tc.currdir[1] ? tc.currdir : "" , name, |
1312 | dir_thumbnail_name); | 1311 | dir_thumbnail_name); |
1313 | 1312 | ||
1314 | DEBUGF("Checking for %s\n", dirname_mp3_filename); | 1313 | DEBUGF("Checking for %s\n", dirname_mp3_filename); |