From 7f7a2d3b13f96637549998cfaa36148c62f4b8cc Mon Sep 17 00:00:00 2001 From: Alexander Levin Date: Thu, 22 Dec 2011 18:56:11 +0000 Subject: [PATCH] Rename 'mp3entry.embed_cuesheet' to 'mp3entry.embedded_cuesheet' and pull out a field (FS#12473) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31406 a1c6a512-1295-4272-9138-f99709370657 --- apps/cuesheet.c | 8 ++++---- apps/metadata.c | 4 ++-- apps/metadata.h | 3 ++- apps/metadata/id3tags.c | 8 ++++---- apps/metadata/vorbis.c | 8 ++++---- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/apps/cuesheet.c b/apps/cuesheet.c index 2c2567b391..354f976997 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c @@ -49,11 +49,11 @@ bool look_for_cuesheet_file(struct mp3entry *track_id3, struct cuesheet_file *cu char cuepath[MAX_PATH]; char *dot, *slash; - if (track_id3->embed_cuesheet.present) + if (track_id3->has_embedded_cuesheet) { - cue_file->pos = track_id3->embed_cuesheet.pos; - cue_file->size = track_id3->embed_cuesheet.size; - cue_file->encoding = track_id3->embed_cuesheet.encoding; + cue_file->pos = track_id3->embedded_cuesheet.pos; + cue_file->size = track_id3->embedded_cuesheet.size; + cue_file->encoding = track_id3->embedded_cuesheet.encoding; strlcpy(cue_file->path, track_id3->path, MAX_PATH); return true; } diff --git a/apps/metadata.c b/apps/metadata.c index 898436781b..2a93c1880c 100644 --- a/apps/metadata.c +++ b/apps/metadata.c @@ -439,8 +439,8 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname) id3->codectype = probe_file_format(trackname); /* default values for embedded cuesheets */ - id3->embed_cuesheet.present = false; - id3->embed_cuesheet.pos = 0; + id3->has_embedded_cuesheet = false; + id3->embedded_cuesheet.pos = 0; entry = &audio_formats[id3->codectype]; diff --git a/apps/metadata.h b/apps/metadata.h index 707e5c2c37..2e16f4d47e 100644 --- a/apps/metadata.h +++ b/apps/metadata.h @@ -322,7 +322,8 @@ struct mp3entry { #endif /* Cuesheet support */ - struct embedded_cuesheet embed_cuesheet; + bool has_embedded_cuesheet; + struct embedded_cuesheet embedded_cuesheet; struct cuesheet *cuesheet; /* Musicbrainz Track ID */ diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c index 85025c61b1..2dd1c662ed 100644 --- a/apps/metadata/id3tags.c +++ b/apps/metadata/id3tags.c @@ -1029,12 +1029,12 @@ void setid3v2title(int fd, struct mp3entry *entry) break; } if (char_enc > 0) { - entry->embed_cuesheet.present = true; - entry->embed_cuesheet.pos = lseek(fd, 0, SEEK_CUR) + entry->has_embedded_cuesheet = true; + entry->embedded_cuesheet.pos = lseek(fd, 0, SEEK_CUR) - framelen + cuesheet_offset; - entry->embed_cuesheet.size = totframelen + entry->embedded_cuesheet.size = totframelen - cuesheet_offset; - entry->embed_cuesheet.encoding = char_enc; + entry->embedded_cuesheet.encoding = char_enc; } break; } diff --git a/apps/metadata/vorbis.c b/apps/metadata/vorbis.c index 29848daa19..58bd781873 100644 --- a/apps/metadata/vorbis.c +++ b/apps/metadata/vorbis.c @@ -353,10 +353,10 @@ long read_vorbis_tags(int fd, struct mp3entry *id3, /* Is it an embedded cuesheet? */ if (!strcasecmp(name, "CUESHEET")) { - id3->embed_cuesheet.present = true; - id3->embed_cuesheet.pos = lseek(file.fd, 0, SEEK_CUR) - read_len; - id3->embed_cuesheet.size = len; - id3->embed_cuesheet.encoding = CHAR_ENC_UTF_8; + id3->has_embedded_cuesheet = true; + id3->embedded_cuesheet.pos = lseek(file.fd, 0, SEEK_CUR) - read_len; + id3->embedded_cuesheet.size = len; + id3->embedded_cuesheet.encoding = CHAR_ENC_UTF_8; } else {