summaryrefslogtreecommitdiff
path: root/apps/metadata/mp4.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/metadata/mp4.c')
-rw-r--r--apps/metadata/mp4.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index a3721f0e9a..9ae174af7e 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -300,8 +300,7 @@ static bool read_mp4_esds(int fd, struct mp3entry* id3, uint32_t* size)
300 /* Skip 13 bits from above, plus 3 bits, then read 11 bits */ 300 /* Skip 13 bits from above, plus 3 bits, then read 11 bits */
301 else if ((length >= 4) && (((bits >> 5) & 0x7ff) == 0x2b7)) 301 else if ((length >= 4) && (((bits >> 5) & 0x7ff) == 0x2b7))
302 { 302 {
303 /* extensionAudioObjectType */ 303 /* We found an extensionAudioObjectType */
304 DEBUGF("MP4: extensionAudioType\n");
305 type = bits & 0x1f; /* Object type - 5 bits*/ 304 type = bits & 0x1f; /* Object type - 5 bits*/
306 bits = get_long_be(&buf[4]); 305 bits = get_long_be(&buf[4]);
307 306
@@ -680,7 +679,6 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
680 { 679 {
681 uint32_t frequency; 680 uint32_t frequency;
682 681
683 id3->codectype = (type == MP4_mp4a) ? AFMT_MP4_AAC : AFMT_MP4_ALAC;
684 lseek(fd, 22, SEEK_CUR); 682 lseek(fd, 22, SEEK_CUR);
685 read_uint32be(fd, &frequency); 683 read_uint32be(fd, &frequency);
686 size -= 26; 684 size -= 26;
@@ -700,11 +698,13 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
700 read_mp4_atom(fd, &subsize, &subtype, size); 698 read_mp4_atom(fd, &subsize, &subtype, size);
701 size -= 10; 699 size -= 10;
702 700
701 id3->codectype = AFMT_MP4_AAC;
703 if (subtype == MP4_esds) 702 if (subtype == MP4_esds)
704 { 703 {
705 sbr_used = read_mp4_esds(fd, id3, &size); 704 sbr_used = read_mp4_esds(fd, id3, &size);
706 if (sbr_used) 705 if (sbr_used)
707 { 706 {
707 id3->codectype = AFMT_MP4_AAC_HE;
708 if (SBR_upsampling_used) 708 if (SBR_upsampling_used)
709 DEBUGF("MP4: AAC-HE, SBR upsampling\n"); 709 DEBUGF("MP4: AAC-HE, SBR upsampling\n");
710 else 710 else
@@ -712,6 +712,11 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
712 } 712 }
713 } 713 }
714 } 714 }
715 else
716 {
717 id3->codectype = AFMT_MP4_ALAC;
718 }
719
715 } 720 }
716 break; 721 break;
717 722