MP4: Add support for comment and year tags.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13998 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5d3bbe6d38
commit
b1d07b465c
1 changed files with 23 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "logf.h"
|
||||
#include "debug.h"
|
||||
#include "replaygain.h"
|
||||
#include "atoi.h"
|
||||
|
||||
#define MP4_ID(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
||||
|
||||
|
@ -40,6 +41,8 @@
|
|||
#define MP4_cgen MP4_ID(0xa9, 'g', 'e', 'n')
|
||||
#define MP4_cnam MP4_ID(0xa9, 'n', 'a', 'm')
|
||||
#define MP4_cwrt MP4_ID(0xa9, 'w', 'r', 't')
|
||||
#define MP4_ccmt MP4_ID(0xa9, 'c', 'm', 't')
|
||||
#define MP4_cday MP4_ID(0xa9, 'd', 'a', 'y')
|
||||
#define MP4_esds MP4_ID('e', 's', 'd', 's')
|
||||
#define MP4_ftyp MP4_ID('f', 't', 'y', 'p')
|
||||
#define MP4_gnre MP4_ID('g', 'n', 'r', 'e')
|
||||
|
@ -385,6 +388,26 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
|
|||
cwrt = false;
|
||||
break;
|
||||
|
||||
case MP4_ccmt:
|
||||
read_mp4_tag_string(fd, size, &buffer, &buffer_left,
|
||||
&id3->comment);
|
||||
break;
|
||||
|
||||
case MP4_cday:
|
||||
read_mp4_tag_string(fd, size, &buffer, &buffer_left,
|
||||
&id3->year_string);
|
||||
|
||||
/* Try to parse it as a year, for the benefit of the database.
|
||||
*/
|
||||
id3->year = atoi(id3->year_string);
|
||||
|
||||
if (id3->year < 1900)
|
||||
{
|
||||
id3->year = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MP4_gnre:
|
||||
{
|
||||
unsigned short genre;
|
||||
|
|
Loading…
Reference in a new issue