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