summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-10-16 11:11:45 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-10-16 11:11:45 +0000
commit00a228fefbfc9058b89ba914755aa9d5f31da085 (patch)
treee48effa29fb610b9382d1af460484a644ac66785 /apps/playback.c
parent71898e5c547e1f92bb128aede558938873f56d3c (diff)
Accept FS#7482 by Klaas Bosteels - return the full path of a file which doesnt have valid tags yet (and use the end of the filename for the title) instead of before which was only using the filename
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18820 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/playback.c b/apps/playback.c
index c7c0b5e9c4..f41cca64a2 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -559,7 +559,6 @@ int audio_current_aa_hid(void)
struct mp3entry* audio_current_track(void)
{
const char *filename;
- const char *p;
static struct mp3entry temp_id3;
struct playlist_track_info trackinfo;
int cur_idx;
@@ -602,14 +601,12 @@ struct mp3entry* audio_current_track(void)
return &temp_id3;
#endif
- p = strrchr(filename, '/');
- if (!p)
- p = filename;
+ strncpy(temp_id3.path, filename, sizeof(temp_id3.path)-1);
+ temp_id3.title = strrchr(temp_id3.path, '/');
+ if (!temp_id3.title)
+ temp_id3.title = &temp_id3.path[0];
else
- p++;
-
- strncpy(temp_id3.path, p, sizeof(temp_id3.path)-1);
- temp_id3.title = &temp_id3.path[0];
+ temp_id3.title++;
return &temp_id3;
}