Change the internal flac fourCC

This commit is contained in:
Damiano Galassi committed 2017-09-27 20:52:08 +02:00
1 parent b42bbace55
commit d727aa8361
3 files changed
+11 -30

No files matched your search

+2 -2
View File
@@ -104,9 +104,9 @@ static const struct {
{ kAudioFormatMPEGLayer3, AV_CODEC_ID_MP3 },
{ kAudioFormatAC3, AV_CODEC_ID_AC3 },
{ kAudioFormatEnhancedAC3, AV_CODEC_ID_EAC3 },
{ 'XiFL', AV_CODEC_ID_FLAC },
{ kAudioFormatFLAC, AV_CODEC_ID_FLAC },
{ 'XiVs', AV_CODEC_ID_VORBIS },
{ 'opus', AV_CODEC_ID_OPUS },
{ kAudioFormatOpus, AV_CODEC_ID_OPUS },
{ kAudioFormatAppleLossless, AV_CODEC_ID_ALAC },
{ 'DTS ', AV_CODEC_ID_DTS },
{ 'trhd', AV_CODEC_ID_TRUEHD },
+8 -27
View File
@@ -70,7 +70,7 @@
case 'ms \0':
result = kMP42AudioCodecType_AC3;
break;
case 'flac':
case 'XiFL':
result = kMP42AudioCodecType_FLAC;
break;
case 'SRT ':
@@ -103,8 +103,8 @@
chapters = [[MP42ChapterTrack alloc] init];
NSArray *chapterList = [_localAsset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:nil];
for (AVTimedMetadataGroup *chapterData in chapterList) {
for (AVMetadataItem *item in [chapterData items]) {
CMTime time = [item time];
for (AVMetadataItem *item in chapterData.items) {
CMTime time = item.time;
[chapters addChapter:[item stringValue] duration:time.value * time.timescale / 1000];
}
}
@@ -771,31 +771,14 @@
return [NSData dataWithBytes:cookieBuffer length:cookieSizeOut];
}
else if (code == 'opus') {
// dec3 atom
// remove the atom header
//cookieBuffer += 9;
//cookieSizeOut = cookieSizeOut - 9;
UInt32 *cookie = (UInt32 *)cookieBuffer;
for (size_t i = 0; i < cookieSizeOut / 8; i++) {
cookie[i] = EndianS32_BtoN(cookie[i]);
}
else if (code == kAudioFormatOpus) {
// TODO
return [NSData dataWithBytes:cookieBuffer length:cookieSizeOut];
}
else if (code == 'flac') {
UInt32 *cookie = (UInt32 *)cookieBuffer;
for (size_t i = 0; i < cookieSizeOut / 8; i++) {
cookie[i] = EndianS32_BtoN(cookie[i]);
}
else if (code == kAudioFormatFLAC) {
// TODO
return [NSData dataWithBytes:cookieBuffer length:cookieSizeOut];
}
else if (code == kAudioFormatEnhancedAC3) {
@@ -879,9 +862,7 @@
CFDictionaryRef extentions = CMFormatDescriptionGetExtensions(formatDescription);
CFDictionaryRef atoms = CFDictionaryGetValue(extentions, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms);
CFDataRef magicCookie = NULL;
magicCookie = CFDictionaryGetValue(atoms, @"vttC");
CFDataRef magicCookie = CFDictionaryGetValue(atoms, @"vttC");
return (NSData *)magicCookie;
}
+1 -1
View File
@@ -145,7 +145,7 @@ enum : MP42AudioCodecType
kMP42AudioCodecType_MicrosoftGSM = 0x6D730031,
kMP42AudioCodecType_AES3 = 'aes3',
kMP42AudioCodecType_EnhancedAC3 = 'ec-3',
kMP42AudioCodecType_FLAC = 'XiFL',
kMP42AudioCodecType_FLAC = 'flac',
kMP42AudioCodecType_Vorbis = 'XiVs',
kMP42AudioCodecType_DTS = 'DTS ',
kMP42AudioCodecType_TrueHD = 'trhd',