summaryrefslogtreecommitdiff
path: root/apps/metadata
diff options
context:
space:
mode:
Diffstat (limited to 'apps/metadata')
-rw-r--r--apps/metadata/mp4.c11
-rw-r--r--apps/metadata/mpc.c4
2 files changed, 12 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
diff --git a/apps/metadata/mpc.c b/apps/metadata/mpc.c
index 0dd76fcc4b..0387dc9f77 100644
--- a/apps/metadata/mpc.c
+++ b/apps/metadata/mpc.c
@@ -125,6 +125,8 @@ bool get_musepack_metadata(int fd, struct mp3entry *id3)
125 125
126 bufused = set_replaygain_sv7(id3, false, header[3], bufused); 126 bufused = set_replaygain_sv7(id3, false, header[3], bufused);
127 bufused = set_replaygain_sv7(id3, true , header[4], bufused); 127 bufused = set_replaygain_sv7(id3, true , header[4], bufused);
128
129 id3->codectype = AFMT_MPC_SV7;
128 } else { 130 } else {
129 return false; /* only SV7 is allowed within a "MP+" signature */ 131 return false; /* only SV7 is allowed within a "MP+" signature */
130 } 132 }
@@ -191,6 +193,8 @@ bool get_musepack_metadata(int fd, struct mp3entry *id3)
191 bufused += set_replaygain_sv8(id3, true , gain, peak, bufused); 193 bufused += set_replaygain_sv8(id3, true , gain, peak, bufused);
192 } 194 }
193 } 195 }
196
197 id3->codectype = AFMT_MPC_SV8;
194 } else { 198 } else {
195 /* No sv8 stream header found */ 199 /* No sv8 stream header found */
196 return false; 200 return false;