Make a MP42Chapter method clearer

This commit is contained in:
Damiano Galassi committed 2025-07-25 17:35:42 +02:00
1 parent 47aadecfff
commit f104a7c69a
4 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ MP42_OBJC_DIRECT_MEMBERS
for (AVMetadataItem *item in chapterData.items) {
CMTime time = item.time;
NSString *title = item.stringValue ? item.stringValue : @"";
[chapters addChapter:title duration:time.value * time.timescale / 1000];
[chapters addChapter:title timestamp:time.value * time.timescale / 1000];
}
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)chapterTrackFromFile:(NSURL *)URL;
- (NSUInteger)addChapter:(MP42TextSample *)chapter;
- (NSUInteger)addChapter:(NSString *)title duration:(uint64_t)timestamp;
- (NSUInteger)addChapter:(NSString *)title timestamp:(uint64_t)timestamp;
- (NSUInteger)addChapter:(NSString *)title image:(MP42Image *)image duration:(uint64_t)timestamp;
- (void)removeChapterAtIndex:(NSUInteger)index;
+1 -1
View File
@@ -118,7 +118,7 @@ MP42_OBJC_DIRECT_MEMBERS
return [_chapters indexOfObject:chapter];
}
- (NSUInteger)addChapter:(NSString *)title duration:(uint64_t)timestamp
- (NSUInteger)addChapter:(NSString *)title timestamp:(uint64_t)timestamp
{
MP42TextSample *newChapter = [[MP42TextSample alloc] init];
newChapter.title = title;
+2 -2
View File
@@ -323,10 +323,10 @@ MP42_OBJC_DIRECT_MEMBERS
}
if (chapters->Children[xi].Display && strlen(chapters->Children[xi].Display->String)) {
[newTrack addChapter:[NSString stringWithUTF8String:chapters->Children[xi].Display->String]
duration:timestamp];
timestamp:timestamp];
} else {
[newTrack addChapter:[NSString stringWithFormat:@"Chapter %d", xi+1]
duration:timestamp];
timestamp:timestamp];
}
}
[self addTrack:newTrack];