Do not crash if the video track has no extension atoms. Fix QuickTime Metadata conversion.
This commit is contained in:
1 file changed
+3
-2
@@ -303,6 +303,7 @@ MP42_OBJC_DIRECT_MEMBERS
|
||||
if (@available(macOS 10.13, *)) {
|
||||
CFDictionaryRef extentions = CMFormatDescriptionGetExtensions(formatDescription);
|
||||
CFDictionaryRef atoms = CFDictionaryGetValue(extentions, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms);
|
||||
if (atoms) {
|
||||
CFDataRef dvExtension = CFDictionaryGetValue(atoms, @"dvcC");
|
||||
|
||||
if (!dvExtension) {
|
||||
@@ -342,7 +343,7 @@ MP42_OBJC_DIRECT_MEMBERS
|
||||
videoTrack.dolbyVisionELConfiguration = (__bridge NSData *)(dvELConfiguration);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
newTrack = videoTrack;
|
||||
@@ -776,7 +777,7 @@ MP42_OBJC_DIRECT_MEMBERS
|
||||
MP42MetadataKeyName, AVMetadataQuickTimeMetadataKeyTitle, nil];
|
||||
|
||||
for (NSString *qtKey in quicktimeMetadataDict.allKeys) {
|
||||
items = [AVMetadataItem metadataItemsFromArray:quicktimeMetadata withKey:qtKey keySpace:AVMetadataKeySpaceQuickTimeUserData];
|
||||
items = [AVMetadataItem metadataItemsFromArray:quicktimeMetadata withKey:qtKey keySpace:AVMetadataKeySpaceQuickTimeMetadata];
|
||||
if (items.count) {
|
||||
[self.metadata addMetadataItem:[self metadataItemWithValue:items.lastObject.value identifier:quicktimeMetadataDict[qtKey]]];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user