summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-07-05 23:33:20 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-07-05 23:33:20 +0000
commitb44714331b2354b08eddb7e6c47c0b05ce9b0243 (patch)
tree1f6ceafd8ba8cf83731031285c8d39a37b520062
parent8436d41b38045682c0c7377b2f0155f69a12862e (diff)
downloadrockbox-b44714331b2354b08eddb7e6c47c0b05ce9b0243.tar.gz
rockbox-b44714331b2354b08eddb7e6c47c0b05ce9b0243.tar.bz2
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
-rw-r--r--apps/filetree.h2
-rw-r--r--apps/tree.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/apps/filetree.h b/apps/filetree.h
index cdcdfca261..c179959053 100644
--- a/apps/filetree.h
+++ b/apps/filetree.h
@@ -22,7 +22,7 @@
int ft_load(struct tree_context* c, const char* tempdir);
int ft_play_filenumber(int pos, int attr);
-int ft_play_dirname(int start_index);
+int ft_play_dirname(char* name);
void ft_play_filename(char *dir, char *file);
int ft_enter(struct tree_context* c);
int ft_exit(struct tree_context* c);
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)
if (attr & ATTR_DIRECTORY)
{
DEBUGF("Playing directory thumbnail: %s", currdir);
- res = ft_play_dirname(lasti);
+ res = ft_play_dirname(name);
if (res < 0) /* failed, not existing */
{ /* say the number instead, as a fallback */
talk_id(VOICE_DIR, false);
@@ -1298,17 +1298,16 @@ int ft_play_filenumber(int pos, int attr)
return 1;
}
-int ft_play_dirname(int start_index)
+int ft_play_dirname(char* name)
{
int fd;
char dirname_mp3_filename[MAX_PATH+1];
- struct entry *dircache = tc.dircache;
if (audio_status() & AUDIO_STATUS_PLAY)
return 0;
snprintf(dirname_mp3_filename, sizeof(dirname_mp3_filename), "%s/%s/%s",
- tc.currdir[1] ? tc.currdir : "" , dircache[start_index].name,
+ tc.currdir[1] ? tc.currdir : "" , name,
dir_thumbnail_name);
DEBUGF("Checking for %s\n", dirname_mp3_filename);