summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/metadata/metadata_common.c2
-rw-r--r--apps/metadata/metadata_common.h2
-rw-r--r--apps/metadata/mp4.c39
3 files changed, 21 insertions, 22 deletions
diff --git a/apps/metadata/metadata_common.c b/apps/metadata/metadata_common.c
index 09f0f94a88..37768bdd4a 100644
--- a/apps/metadata/metadata_common.c
+++ b/apps/metadata/metadata_common.c
@@ -99,7 +99,7 @@ long read_string(int fd, char* buf, long buf_size, int eos, long size)
99 99
100#ifdef ROCKBOX_LITTLE_ENDIAN 100#ifdef ROCKBOX_LITTLE_ENDIAN
101/* Read an unsigned 32-bit integer from a big-endian file. */ 101/* Read an unsigned 32-bit integer from a big-endian file. */
102int read_uint32be(int fd, unsigned int* buf) 102int read_uint32be(int fd, uint32_t* buf)
103{ 103{
104 size_t n; 104 size_t n;
105 105
diff --git a/apps/metadata/metadata_common.h b/apps/metadata/metadata_common.h
index f57690af91..2a48b25dc6 100644
--- a/apps/metadata/metadata_common.h
+++ b/apps/metadata/metadata_common.h
@@ -44,7 +44,7 @@ int read_uint16le(int fd, uint16_t* buf);
44int read_uint32le(int fd, uint32_t* buf); 44int read_uint32le(int fd, uint32_t* buf);
45int read_uint64le(int fd, uint64_t* buf); 45int read_uint64le(int fd, uint64_t* buf);
46#else 46#else
47int read_uint32be(int fd, unsigned int* buf); 47int read_uint32be(int fd, uint32_t* buf);
48#define read_uint16le(fd,buf) read((fd), (buf), 2) 48#define read_uint16le(fd,buf) read((fd), (buf), 2)
49#define read_uint32le(fd,buf) read((fd), (buf), 4) 49#define read_uint32le(fd,buf) read((fd), (buf), 4)
50#define read_uint64le(fd,buf) read((fd), (buf), 8) 50#define read_uint64le(fd,buf) read((fd), (buf), 8)
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index b6aeaf1581..af2a301e73 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -130,8 +130,8 @@ static unsigned int read_mp4_tag_string(int fd, int size_left, char** buffer,
130 return length; 130 return length;
131} 131}
132 132
133static unsigned int read_mp4_atom(int fd, unsigned int* size, 133static unsigned int read_mp4_atom(int fd, uint32_t* size,
134 unsigned int* type, unsigned int size_left) 134 uint32_t* type, uint32_t size_left)
135{ 135{
136 read_uint32be(fd, size); 136 read_uint32be(fd, size);
137 read_uint32be(fd, type); 137 read_uint32be(fd, type);
@@ -168,7 +168,7 @@ static unsigned int read_mp4_atom(int fd, unsigned int* size,
168 return size_left; 168 return size_left;
169} 169}
170 170
171static unsigned int read_mp4_length(int fd, unsigned int* size) 171static unsigned int read_mp4_length(int fd, uint32_t* size)
172{ 172{
173 unsigned int length = 0; 173 unsigned int length = 0;
174 int bytes = 0; 174 int bytes = 0;
@@ -186,8 +186,7 @@ static unsigned int read_mp4_length(int fd, unsigned int* size)
186 return length; 186 return length;
187} 187}
188 188
189static bool read_mp4_esds(int fd, struct mp3entry* id3, 189static bool read_mp4_esds(int fd, struct mp3entry* id3, uint32_t* size)
190 unsigned int* size)
191{ 190{
192 unsigned char buf[8]; 191 unsigned char buf[8];
193 bool sbr = false; 192 bool sbr = false;
@@ -349,10 +348,10 @@ static bool read_mp4_esds(int fd, struct mp3entry* id3,
349} 348}
350 349
351static bool read_mp4_tags(int fd, struct mp3entry* id3, 350static bool read_mp4_tags(int fd, struct mp3entry* id3,
352 unsigned int size_left) 351 uint32_t size_left)
353{ 352{
354 unsigned int size; 353 uint32_t size;
355 unsigned int type; 354 uint32_t type;
356 unsigned int buffer_left = sizeof(id3->id3v2buf) + sizeof(id3->id3v1buf); 355 unsigned int buffer_left = sizeof(id3->id3v2buf) + sizeof(id3->id3v1buf);
357 char* buffer = id3->id3v2buf; 356 char* buffer = id3->id3v2buf;
358 bool cwrt = false; 357 bool cwrt = false;
@@ -456,7 +455,7 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
456 case MP4_extra: 455 case MP4_extra:
457 { 456 {
458 char tag_name[TAG_NAME_LENGTH]; 457 char tag_name[TAG_NAME_LENGTH];
459 unsigned int sub_size; 458 uint32_t sub_size;
460 459
461 /* "mean" atom */ 460 /* "mean" atom */
462 read_uint32be(fd, &sub_size); 461 read_uint32be(fd, &sub_size);
@@ -543,11 +542,11 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
543} 542}
544 543
545static bool read_mp4_container(int fd, struct mp3entry* id3, 544static bool read_mp4_container(int fd, struct mp3entry* id3,
546 unsigned int size_left) 545 uint32_t size_left)
547{ 546{
548 unsigned int size; 547 uint32_t size;
549 unsigned int type; 548 uint32_t type;
550 unsigned int handler = 0; 549 uint32_t handler = 0;
551 bool rc = true; 550 bool rc = true;
552 551
553 do 552 do
@@ -562,7 +561,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
562 { 561 {
563 case MP4_ftyp: 562 case MP4_ftyp:
564 { 563 {
565 unsigned int id; 564 uint32_t id;
566 565
567 read_uint32be(fd, &id); 566 read_uint32be(fd, &id);
568 size -= 4; 567 size -= 4;
@@ -625,7 +624,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
625 624
626 case MP4_stts: 625 case MP4_stts:
627 { 626 {
628 unsigned int entries; 627 uint32_t entries;
629 unsigned int i; 628 unsigned int i;
630 629
631 lseek(fd, 4, SEEK_CUR); 630 lseek(fd, 4, SEEK_CUR);
@@ -634,8 +633,8 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
634 633
635 for (i = 0; i < entries; i++) 634 for (i = 0; i < entries; i++)
636 { 635 {
637 unsigned int n; 636 uint32_t n;
638 unsigned int l; 637 uint32_t l;
639 638
640 read_uint32be(fd, &n); 639 read_uint32be(fd, &n);
641 read_uint32be(fd, &l); 640 read_uint32be(fd, &l);
@@ -649,7 +648,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
649 case MP4_mp4a: 648 case MP4_mp4a:
650 case MP4_alac: 649 case MP4_alac:
651 { 650 {
652 unsigned int frequency; 651 uint32_t frequency;
653 652
654 id3->codectype = (type == MP4_mp4a) ? AFMT_AAC : AFMT_ALAC; 653 id3->codectype = (type == MP4_mp4a) ? AFMT_AAC : AFMT_ALAC;
655 lseek(fd, 22, SEEK_CUR); 654 lseek(fd, 22, SEEK_CUR);
@@ -659,8 +658,8 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
659 658
660 if (type == MP4_mp4a) 659 if (type == MP4_mp4a)
661 { 660 {
662 unsigned int subsize; 661 uint32_t subsize;
663 unsigned int subtype; 662 uint32_t subtype;
664 663
665 /* Get frequency from the decoder info tag, if possible. */ 664 /* Get frequency from the decoder info tag, if possible. */
666 lseek(fd, 2, SEEK_CUR); 665 lseek(fd, 2, SEEK_CUR);