From 6bb26182bac9ece6b8539c50a63d0960af2ee374 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Tue, 15 Oct 2019 08:32:21 +0200 Subject: [PATCH] Update MP4Dump. --- Utilities/MP4Dump/AppDelegate.m | 16 +++++----- Utilities/MP4Dump/Base.lproj/MyDocument.xib | 29 ++++++++++--------- .../MP4Dump/MP4Dump.xcodeproj/project.pbxproj | 8 +++-- Utilities/MP4Dump/MyDocument.m | 14 +++++---- 4 files changed, 36 insertions(+), 31 deletions(-) diff --git a/Utilities/MP4Dump/AppDelegate.m b/Utilities/MP4Dump/AppDelegate.m index 43afea3..fc76294 100755 --- a/Utilities/MP4Dump/AppDelegate.m +++ b/Utilities/MP4Dump/AppDelegate.m @@ -14,17 +14,17 @@ NSString *libraryPath = nil; void logCallback(MP4LogLevel loglevel, const char* fmt, va_list ap) { if (!libraryPath) { - NSString *libraryDir = NSSearchPathForDirectoriesInDomains( NSLibraryDirectory, - NSUserDomainMask, - YES ).firstObject; + NSString *libraryDir = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, + NSUserDomainMask, + YES).firstObject; NSString *AppSupportDirectory = [[libraryDir stringByAppendingPathComponent:@"Application Support"] stringByAppendingPathComponent:@"MP4Dump"]; - if (![[NSFileManager defaultManager] fileExistsAtPath:AppSupportDirectory]) { - [[NSFileManager defaultManager] createDirectoryAtPath:AppSupportDirectory - withIntermediateDirectories:YES - attributes:nil - error:NULL]; + if (![NSFileManager.defaultManager fileExistsAtPath:AppSupportDirectory]) { + [NSFileManager.defaultManager createDirectoryAtPath:AppSupportDirectory + withIntermediateDirectories:YES + attributes:nil + error:NULL]; } libraryPath = [AppSupportDirectory stringByAppendingPathComponent:@"temp.txt"]; diff --git a/Utilities/MP4Dump/Base.lproj/MyDocument.xib b/Utilities/MP4Dump/Base.lproj/MyDocument.xib index cbe5755..b0b72d9 100755 --- a/Utilities/MP4Dump/Base.lproj/MyDocument.xib +++ b/Utilities/MP4Dump/Base.lproj/MyDocument.xib @@ -1,8 +1,8 @@ - + - + @@ -18,45 +18,45 @@ - + - + - - + + - + - - + + + - + - - + - + - + @@ -103,6 +103,7 @@ + diff --git a/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj b/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj index fae8b65..0b6f8c8 100755 --- a/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj +++ b/Utilities/MP4Dump/MP4Dump.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -158,10 +158,10 @@ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1120; }; buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "MP4Dump" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( @@ -248,6 +248,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -272,6 +273,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; diff --git a/Utilities/MP4Dump/MyDocument.m b/Utilities/MP4Dump/MyDocument.m index 1e1b6f2..e9d1ec3 100755 --- a/Utilities/MP4Dump/MyDocument.m +++ b/Utilities/MP4Dump/MyDocument.m @@ -60,14 +60,17 @@ extern NSString *libraryPath; { MP4FileHandle fileHandle = MP4Read(absoluteURL.fileSystemRepresentation); - MP4Dump(fileHandle, 0); + MP4LogLevel level = (MP4LogLevel)[NSUserDefaults.standardUserDefaults integerForKey:@"LogLevel"]; + MP4LogSetLevel(level); + MP4Dump(fileHandle, 0); MP4Close(fileHandle, 0); + result = [NSString stringWithContentsOfFile:libraryPath encoding:NSASCIIStringEncoding error:outError]; - if ([[NSFileManager defaultManager] isDeletableFileAtPath:libraryPath]) - [[NSFileManager defaultManager] removeItemAtPath:libraryPath error:nil]; - + if ([NSFileManager.defaultManager isDeletableFileAtPath:libraryPath]) { + [NSFileManager.defaultManager removeItemAtPath:libraryPath error:nil]; + } if (result) { return YES; } @@ -80,7 +83,6 @@ extern NSString *libraryPath; { if (outError != NULL && ![self _loadFileDump:absoluteURL error:outError]) { *outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL]; - return NO; } @@ -94,7 +96,7 @@ extern NSString *libraryPath; - (IBAction)setLogLevel:(id)sender { MP4LogLevel level = (MP4LogLevel)[sender tag]; - [[NSUserDefaults standardUserDefaults] setInteger:level forKey:@"LogLevel"]; + [NSUserDefaults.standardUserDefaults setInteger:level forKey:@"LogLevel"]; MP4LogSetLevel(level); if ([self _loadFileDump:self.fileURL error:nil]) {