mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-16 00:58:18 -04:00
add support for POPM in mp3 files, closing ticket #149
This commit is contained in:
parent
166d351ad1
commit
57debc0493
@ -298,6 +298,7 @@ int scan_mp3_get_mp3tags(char *file, MP3FILE *pmp3) {
|
|||||||
id3_ucs4_t const *native_text;
|
id3_ucs4_t const *native_text;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int got_numeric_genre;
|
int got_numeric_genre;
|
||||||
|
int rating;
|
||||||
|
|
||||||
pid3file=id3_file_open(file,ID3_FILE_MODE_READONLY);
|
pid3file=id3_file_open(file,ID3_FILE_MODE_READONLY);
|
||||||
if(!pid3file) {
|
if(!pid3file) {
|
||||||
@ -444,6 +445,21 @@ int scan_mp3_get_mp3tags(char *file, MP3FILE *pmp3) {
|
|||||||
if((!used) && (have_utf8) && (utf8_text))
|
if((!used) && (have_utf8) && (utf8_text))
|
||||||
free(utf8_text);
|
free(utf8_text);
|
||||||
|
|
||||||
|
if((!strcmp(pid3frame->id,"POPM")) && (pid3frame->nfields == 3)) {
|
||||||
|
rating = id3_field_getint(&pid3frame->fields[1]);
|
||||||
|
if(rating >= 0x01)
|
||||||
|
pmp3->rating = 20;
|
||||||
|
if(rating >= 0x40)
|
||||||
|
pmp3->rating = 40;
|
||||||
|
if(rating >= 0x80)
|
||||||
|
pmp3->rating = 60;
|
||||||
|
if(rating >= 0xC4)
|
||||||
|
pmp3->rating = 80;
|
||||||
|
if(rating >= 0xFF)
|
||||||
|
pmp3->rating = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* v2 COMM tags are a bit different than v1 */
|
/* v2 COMM tags are a bit different than v1 */
|
||||||
if((!strcmp(pid3frame->id,"COMM")) && (pid3frame->nfields == 4)) {
|
if((!strcmp(pid3frame->id,"COMM")) && (pid3frame->nfields == 4)) {
|
||||||
/* Make sure it isn't a application-specific comment...
|
/* Make sure it isn't a application-specific comment...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user