Fix timescale conversion

This commit is contained in:
Damiano Galassi committed 2025-11-14 15:27:25 +01:00
1 parent 841a7d083e
commit 9b34bb2ece
1 file changed
+2 -2
+2 -2
View File
@@ -104,9 +104,9 @@ MP42_OBJC_DIRECT_MEMBERS
NSArray *chapterList = [_localAsset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:nil];
for (AVTimedMetadataGroup *chapterData in chapterList) {
for (AVMetadataItem *item in chapterData.items) {
CMTime time = item.time;
CMTime timestamp = CMTimeConvertScale(item.time, 1000, kCMTimeRoundingMethod_QuickTime);
NSString *title = item.stringValue ? item.stringValue : @"";
[chapters addChapter:title timestamp:time.value * time.timescale / 1000];
[chapters addChapter:title timestamp:timestamp.value];
}
}
}