diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-04-02 19:40:53 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-04-02 19:40:53 +0000 |
commit | bbe1eaf89ed2345af0ad5d865dcb1d2f58bf40bd (patch) | |
tree | 22fbfc5d3b7aeca9fab098a3b456a665fd23d2d3 /apps/cuesheet.c | |
parent | 2a72a2fb59c098c30a11eaf497a01900b8fd3d9d (diff) | |
download | rockbox-bbe1eaf89ed2345af0ad5d865dcb1d2f58bf40bd.tar.gz rockbox-bbe1eaf89ed2345af0ad5d865dcb1d2f58bf40bd.zip |
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
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r-- | apps/cuesheet.c | 19 |
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) | |||
351 | 351 | ||
352 | void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3) | 352 | void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3) |
353 | { | 353 | { |
354 | if (!cue) | 354 | if (!cue || !cue->curr_track) |
355 | return; | 355 | return; |
356 | 356 | ||
357 | int i = cue->curr_track_idx; | 357 | struct cue_track_info *track = cue->curr_track; |
358 | 358 | ||
359 | id3->title = cue->tracks[i].title; | 359 | id3->title = *track->title ? track->title : NULL; |
360 | id3->artist = cue->tracks[i].performer; | 360 | id3->artist = *track->performer ? track->performer : NULL; |
361 | id3->composer = cue->tracks[i].songwriter; | 361 | id3->composer = *track->songwriter ? track->songwriter : NULL; |
362 | id3->album = *cue->title ? cue->title : NULL; | ||
362 | 363 | ||
363 | /* if the album artist is the same as the track artist, we hide it. */ | 364 | /* if the album artist is the same as the track artist, we hide it. */ |
364 | if (strcmp(cue->performer, cue->tracks[i].performer)) | 365 | if (strcmp(cue->performer, track->performer)) |
365 | id3->albumartist = cue->performer; | 366 | id3->albumartist = *cue->performer ? cue->performer : NULL; |
366 | else | 367 | else |
367 | id3->albumartist = "\0"; | 368 | id3->albumartist = NULL; |
368 | 369 | ||
370 | int i = cue->curr_track_idx; | ||
369 | id3->tracknum = i+1; | 371 | id3->tracknum = i+1; |
370 | id3->album = cue->title; | ||
371 | if (id3->track_string) | 372 | if (id3->track_string) |
372 | snprintf(id3->track_string, 10, "%d/%d", i+1, cue->track_count); | 373 | snprintf(id3->track_string, 10, "%d/%d", i+1, cue->track_count); |
373 | } | 374 | } |