add compilation flag for id3v2.2

This commit is contained in:
Ron Pedde 2004-10-31 00:19:45 +00:00
parent 31ff9fc39c
commit baf7ba8bda
1 changed files with 146 additions and 143 deletions

View File

@ -475,8 +475,6 @@ void scan_music_file(char *path, struct dirent *pde, struct stat *psb) {
/* FIXME; assumes that st_ino is a u_int_32 /* FIXME; assumes that st_ino is a u_int_32
DWB: also assumes that the library is contained entirely within DWB: also assumes that the library is contained entirely within
one file system one file system
REP: true, although linux doesn't even guarantee a unique inode
within a single device!
*/ */
mp3file.id=psb->st_ino; mp3file.id=psb->st_ino;
@ -719,6 +717,11 @@ int scan_get_mp3tags(char *file, MP3FILE *pmp3) {
have_utf8=0; have_utf8=0;
have_text=0; have_text=0;
if(!strcmp(pid3frame->id,"YTCP")) { /* for id3v2.2 */
pmp3->compilation = 1;
DPRINTF(ERR_DEBUG, "Compilation: %d\n", pmp3->compilation);
}
if(((pid3frame->id[0] == 'T')||(strcmp(pid3frame->id,"COMM")==0)) && if(((pid3frame->id[0] == 'T')||(strcmp(pid3frame->id,"COMM")==0)) &&
(id3_field_getnstrings(&pid3frame->fields[1]))) (id3_field_getnstrings(&pid3frame->fields[1])))
have_text=1; have_text=1;
@ -812,7 +815,7 @@ int scan_get_mp3tags(char *file, MP3FILE *pmp3) {
} else if(!strcmp(pid3frame->id,"TBPM")) { } else if(!strcmp(pid3frame->id,"TBPM")) {
pmp3->bpm = atoi(utf8_text); pmp3->bpm = atoi(utf8_text);
DPRINTF(ERR_DEBUG, "BPM: %d\n", pmp3->bpm); DPRINTF(ERR_DEBUG, "BPM: %d\n", pmp3->bpm);
} else if(!strcmp(pid3frame->id,"TCMP")) { } else if(!strcmp(pid3frame->id,"TCMP")) { /* for id3v2.3 */
pmp3->compilation = (char)atoi(utf8_text); pmp3->compilation = (char)atoi(utf8_text);
DPRINTF(ERR_DEBUG, "Compilation: %d\n", pmp3->compilation); DPRINTF(ERR_DEBUG, "Compilation: %d\n", pmp3->compilation);
} }
@ -1032,17 +1035,17 @@ int scan_get_aacfileinfo(char *file, MP3FILE *pmp3) {
pmp3->bitrate = ntohl(bit_rate) / 1000; pmp3->bitrate = ntohl(bit_rate) / 1000;
} else { } else {
DPRINTF(ERR_LOG, "Could not find 'esds' atom to determine bit rate.\n"); DPRINTF(ERR_DEBUG, "Could not find 'esds' atom to determine bit rate.\n");
} }
} else { } else {
DPRINTF(ERR_LOG, "Could not find 'mp4a' atom to determine sample rate.\n"); DPRINTF(ERR_DEBUG, "Could not find 'mp4a' atom to determine sample rate.\n");
} }
/* Fallback if we can't find the info in the atoms. */ /* Fallback if we can't find the info in the atoms. */
if (pmp3->bitrate == 0) { if (pmp3->bitrate == 0) {
/* calculate bitrate from song length... Kinda cheesy */ /* calculate bitrate from song length... Kinda cheesy */
DPRINTF(ERR_LOG, "Could not find 'esds' atom. Calculating bit rate.\n"); DPRINTF(ERR_DEBUG, "Could not find 'esds' atom. Calculating bit rate.\n");
atom_offset=aac_drilltoatom(infile,"mdat",&atom_length); atom_offset=aac_drilltoatom(infile,"mdat",&atom_length);