From afe8f0e1ffdd364fc16e725e33e62c3bc1660b04 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 1 Sep 2017 14:20:18 +0200 Subject: [PATCH] Fix error condition. --- MP42/MP42AudioTrack.m | 2 +- MP42/MP42SubtitleTrack.m | 4 ++-- MP42/MP42VideoTrack.m | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MP42/MP42AudioTrack.m b/MP42/MP42AudioTrack.m index e79e76b..fdad8ae 100644 --- a/MP42/MP42AudioTrack.m +++ b/MP42/MP42AudioTrack.m @@ -163,7 +163,7 @@ - (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError { - if (!fileHandle || !self.trackId || [super writeToFile:fileHandle error:outError]) { + if (!fileHandle || !self.trackId || ![super writeToFile:fileHandle error:outError]) { if (outError != NULL) { *outError = MP42Error(MP42LocalizedString(@"Error: couldn't mux audio track", @"error message"), nil, diff --git a/MP42/MP42SubtitleTrack.m b/MP42/MP42SubtitleTrack.m index d8fbb47..d4a7968 100644 --- a/MP42/MP42SubtitleTrack.m +++ b/MP42/MP42SubtitleTrack.m @@ -68,7 +68,7 @@ - (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError { - if (!fileHandle || !self.trackId) { + if (!fileHandle || !self.trackId || ![super writeToFile:fileHandle error:outError]) { if (outError != NULL) { *outError = MP42Error(MP42LocalizedString(@"Error: couldn't mux subtitle track", @"error message"), nil, @@ -112,7 +112,7 @@ MP4SetTrackIntegerProperty(fileHandle, self.trackId, "mdia.minf.stbl.stsd.tx3g.displayFlags", displayFlags); } - return [super writeToFile:fileHandle error:outError]; + return YES; } - (void)setSomeSamplesAreForced:(BOOL)value diff --git a/MP42/MP42VideoTrack.m b/MP42/MP42VideoTrack.m index 77e7408..f31b649 100644 --- a/MP42/MP42VideoTrack.m +++ b/MP42/MP42VideoTrack.m @@ -127,7 +127,7 @@ - (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError { - if (!fileHandle || !self.trackId || [super writeToFile:fileHandle error:outError]) { + if (!fileHandle || !self.trackId || ![super writeToFile:fileHandle error:outError]) { if (outError != NULL) { *outError = MP42Error(MP42LocalizedString(@"Error: couldn't mux video track", @"error message"), nil,