OCD.
This commit is contained in:
5 files changed
+18
-25
No files matched your search
@@ -163,12 +163,13 @@
|
|||||||
|
|
||||||
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
|
- (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;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.trackId) {
|
|
||||||
[super writeToFile:fileHandle error:outError];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.updatedProperty[@"volume"] || !self.muxed) {
|
if (self.updatedProperty[@"volume"] || !self.muxed) {
|
||||||
@@ -209,7 +210,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (self.trackId > 0);
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setConversionSettings:(MP42AudioConversionSettings *)conversionSettings
|
- (void)setConversionSettings:(MP42AudioConversionSettings *)conversionSettings
|
||||||
|
|||||||
@@ -24,13 +24,7 @@
|
|||||||
|
|
||||||
- (BOOL)writeToFile:(MP42FileHandle)fileHandle error:(NSError **)outError
|
- (BOOL)writeToFile:(MP42FileHandle)fileHandle error:(NSError **)outError
|
||||||
{
|
{
|
||||||
if (self.isEdited && !self.muxed) {
|
return [super writeToFile:fileHandle error:outError];
|
||||||
self.muxed = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
[super writeToFile:fileHandle error:outError];
|
|
||||||
|
|
||||||
return (self.trackId > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
if (MP4HaveTrackAtom(fileHandle, self.trackId, "tref.forc")) {
|
if (MP4HaveTrackAtom(fileHandle, self.trackId, "tref.forc")) {
|
||||||
uint64_t forcedId = 0;
|
uint64_t forcedId = 0;
|
||||||
MP4GetTrackIntegerProperty(fileHandle, self.trackId, "tref.forc.entries.trackId", &forcedId);
|
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);
|
MP4SetTrackIntegerProperty(fileHandle, self.trackId, "mdia.minf.stbl.stsd.tx3g.displayFlags", displayFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
[super writeToFile:fileHandle error:outError];
|
return [super writeToFile:fileHandle error:outError];
|
||||||
|
|
||||||
return self.trackId > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setSomeSamplesAreForced:(BOOL)value
|
- (void)setSomeSamplesAreForced:(BOOL)value
|
||||||
|
|||||||
+1
-3
@@ -191,8 +191,6 @@
|
|||||||
|
|
||||||
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
|
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
|
||||||
{
|
{
|
||||||
BOOL success = YES;
|
|
||||||
|
|
||||||
if (!fileHandle || !_trackId) {
|
if (!fileHandle || !_trackId) {
|
||||||
if ( outError != NULL) {
|
if ( outError != NULL) {
|
||||||
*outError = MP42Error(MP42LocalizedString(@"Failed to modify track", @"error message"),
|
*outError = MP42Error(MP42LocalizedString(@"Failed to modify track", @"error message"),
|
||||||
@@ -239,7 +237,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void *)muxer_helper
|
- (void *)muxer_helper
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#import "MP42Track+Private.h"
|
#import "MP42Track+Private.h"
|
||||||
#import "MP42MediaFormat.h"
|
#import "MP42MediaFormat.h"
|
||||||
#import "MP42Track+Private.h"
|
#import "MP42Track+Private.h"
|
||||||
|
#import "MP42PrivateUtilities.h"
|
||||||
#import <mp4v2.h>
|
#import <mp4v2.h>
|
||||||
|
|
||||||
@implementation MP42VideoTrack
|
@implementation MP42VideoTrack
|
||||||
@@ -126,12 +127,14 @@
|
|||||||
|
|
||||||
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
|
- (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;
|
return NO;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (self.trackId) {
|
|
||||||
[super writeToFile:fileHandle error:outError];
|
|
||||||
|
|
||||||
if (_trackWidth > 0 && _trackHeight > 0) {
|
if (_trackWidth > 0 && _trackHeight > 0) {
|
||||||
MP4SetTrackFloatProperty(fileHandle, self.trackId, "tkhd.width", _trackWidth);
|
MP4SetTrackFloatProperty(fileHandle, self.trackId, "tkhd.width", _trackWidth);
|
||||||
@@ -220,9 +223,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return (self.trackId > 0);
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setTrackWidth:(float)trackWidth
|
- (void)setTrackWidth:(float)trackWidth
|
||||||
|
|||||||
Reference in new issue
Block a user