Cosmetics.

This commit is contained in:
Damiano Galassi committed 2014-03-11 19:48:28 +01:00
1 parent 1b17ce90b2
commit b29092a153
1 file changed
+7 -8
+7 -8
View File
@@ -48,8 +48,7 @@
unsigned int i = 1; unsigned int i = 1;
MP4Duration sum = 0; MP4Duration sum = 0;
while (i <= chapter_count) while (i <= chapter_count) {
{
MP42TextSample *chapter = [[MP42TextSample alloc] init]; MP42TextSample *chapter = [[MP42TextSample alloc] init];
char *title = chapter_list[i-1].title; char *title = chapter_list[i-1].title;
@@ -57,8 +56,7 @@
chapter.title = [[[NSString alloc] initWithBytes:title chapter.title = [[[NSString alloc] initWithBytes:title
length:chapter_list[i-1].titleLength length:chapter_list[i-1].titleLength
encoding:NSUTF16StringEncoding] autorelease]; encoding:NSUTF16StringEncoding] autorelease];
} } else {
else {
chapter.title = [NSString stringWithCString:chapter_list[i-1].title encoding: NSUTF8StringEncoding]; chapter.title = [NSString stringWithCString:chapter_list[i-1].title encoding: NSUTF8StringEncoding];
} }
@@ -225,9 +223,9 @@
MP42TextSample * nextChapter = [chapters objectAtIndex:i+1]; MP42TextSample * nextChapter = [chapters objectAtIndex:i+1];
fileChapters[i].duration = nextChapter.timestamp - chapter.timestamp; fileChapters[i].duration = nextChapter.timestamp - chapter.timestamp;
sum = nextChapter.timestamp; sum = nextChapter.timestamp;
} } else {
else
fileChapters[i].duration = refTrackDuration - chapter.timestamp; fileChapters[i].duration = refTrackDuration - chapter.timestamp;
}
if (sum > refTrackDuration) { if (sum > refTrackDuration) {
fileChapters[i].duration = refTrackDuration - chapter.timestamp; fileChapters[i].duration = refTrackDuration - chapter.timestamp;
@@ -243,6 +241,7 @@
success = _Id = findChapterTrackId(fileHandle); success = _Id = findChapterTrackId(fileHandle);
} }
} }
if (!success) { if (!success) {
if (outError != NULL) if (outError != NULL)
*outError = MP42Error(@"Failed to mux chapters into mp4 file", *outError = MP42Error(@"Failed to mux chapters into mp4 file",
@@ -250,9 +249,9 @@
120); 120);
return success; return success;
} } else if (_Id) {
else if (_Id)
success = [super writeToFile:fileHandle error:outError]; success = [super writeToFile:fileHandle error:outError];
}
return success; return success;
} }