summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-04-02 19:40:53 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-04-02 19:40:53 +0000
commitbbe1eaf89ed2345af0ad5d865dcb1d2f58bf40bd (patch)
tree22fbfc5d3b7aeca9fab098a3b456a665fd23d2d3
parent2a72a2fb59c098c30a11eaf497a01900b8fd3d9d (diff)
Improve ID3 "spoofing" to allow detection of missing information by the WPS.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13005 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/cuesheet.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index 2b876be77f..fd7c7d34f1 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -351,23 +351,24 @@ bool curr_cuesheet_skip(int direction, unsigned long curr_pos)
void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3)
{
- if (!cue)
+ if (!cue || !cue->curr_track)
return;
- int i = cue->curr_track_idx;
+ struct cue_track_info *track = cue->curr_track;
- id3->title = cue->tracks[i].title;
- id3->artist = cue->tracks[i].performer;
- id3->composer = cue->tracks[i].songwriter;
+ id3->title = *track->title ? track->title : NULL;
+ id3->artist = *track->performer ? track->performer : NULL;
+ id3->composer = *track->songwriter ? track->songwriter : NULL;
+ id3->album = *cue->title ? cue->title : NULL;
/* if the album artist is the same as the track artist, we hide it. */
- if (strcmp(cue->performer, cue->tracks[i].performer))
- id3->albumartist = cue->performer;
+ if (strcmp(cue->performer, track->performer))
+ id3->albumartist = *cue->performer ? cue->performer : NULL;
else
- id3->albumartist = "\0";
+ id3->albumartist = NULL;
+ int i = cue->curr_track_idx;
id3->tracknum = i+1;
- id3->album = cue->title;
if (id3->track_string)
snprintf(id3->track_string, 10, "%d/%d", i+1, cue->track_count);
}