This commit is contained in:
Damiano Galassi committed 2017-09-01 14:16:28 +02:00
1 parent e131e4ccf1
commit 7f0ca454ba
5 files changed
+18 -25

No files matched your search

+6 -5
View File
@@ -163,12 +163,13 @@
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
{
if (!fileHandle) {
if (!fileHandle || !self.trackId || [super writeToFile:fileHandle error:outError]) {
if (outError != NULL) {
*outError = MP42Error(MP42LocalizedString(@"Error: couldn't mux audio track", @"error message"),
nil,
120);
return NO;
}
if (self.trackId) {
[super writeToFile:fileHandle error:outError];
}
if (self.updatedProperty[@"volume"] || !self.muxed) {
@@ -209,7 +210,7 @@
}
}
return (self.trackId > 0);
return YES;
}
- (void)setConversionSettings:(MP42AudioConversionSettings *)conversionSettings
+1 -7
View File
@@ -24,13 +24,7 @@
- (BOOL)writeToFile:(MP42FileHandle)fileHandle error:(NSError **)outError
{
if (self.isEdited && !self.muxed) {
self.muxed = YES;
}
[super writeToFile:fileHandle error:outError];
return (self.trackId > 0);
return [super writeToFile:fileHandle error:outError];
}
@end
+2 -4
View File
@@ -49,7 +49,7 @@
if (MP4HaveTrackAtom(fileHandle, self.trackId, "tref.forc")) {
uint64_t forcedId = 0;
MP4GetTrackIntegerProperty(fileHandle, self.trackId, "tref.forc.entries.trackId", &forcedId);
_forcedTrackId = (MP4TrackId) forcedId;
_forcedTrackId = forcedId;
}
}
@@ -112,9 +112,7 @@
MP4SetTrackIntegerProperty(fileHandle, self.trackId, "mdia.minf.stbl.stsd.tx3g.displayFlags", displayFlags);
}
[super writeToFile:fileHandle error:outError];
return self.trackId > 0;
return [super writeToFile:fileHandle error:outError];
}
- (void)setSomeSamplesAreForced:(BOOL)value
+1 -3
View File
@@ -191,8 +191,6 @@
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
{
BOOL success = YES;
if (!fileHandle || !_trackId) {
if ( outError != NULL) {
*outError = MP42Error(MP42LocalizedString(@"Failed to modify track", @"error message"),
@@ -239,7 +237,7 @@
}
}
return success;
return YES;
}
- (void *)muxer_helper
+8 -6
View File
@@ -10,6 +10,7 @@
#import "MP42Track+Private.h"
#import "MP42MediaFormat.h"
#import "MP42Track+Private.h"
#import "MP42PrivateUtilities.h"
#import <mp4v2.h>
@implementation MP42VideoTrack
@@ -126,12 +127,14 @@
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
{
if (!fileHandle) {
if (!fileHandle || !self.trackId || [super writeToFile:fileHandle error:outError]) {
if (outError != NULL) {
*outError = MP42Error(MP42LocalizedString(@"Error: couldn't mux video track", @"error message"),
nil,
120);
return NO;
}
if (self.trackId) {
[super writeToFile:fileHandle error:outError];
}
if (_trackWidth > 0 && _trackHeight > 0) {
MP4SetTrackFloatProperty(fileHandle, self.trackId, "tkhd.width", _trackWidth);
@@ -220,9 +223,8 @@
}
}
}
}
return (self.trackId > 0);
return YES;
}
- (void)setTrackWidth:(float)trackWidth