Two small fixes to error handling in MP42File.
This commit is contained in:
1 parent
4140eee606
commit
196dc6effc
1 file changed
+9
-2
+9
-2
@@ -564,6 +564,9 @@ static void logCallback(MP4LogLevel loglevel, const char* fmt, va_list ap)
|
|||||||
self.URL = result;
|
self.URL = result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Remove the temp file if the optimization didn't complete
|
||||||
|
[fileManager removeItemAtPath:[tempURL path] error:NULL];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -606,6 +609,9 @@ static void logCallback(MP4LogLevel loglevel, const char* fmt, va_list ap)
|
|||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||||
noErr = [fileManager copyItemAtURL:self.URL toURL:url error:outError];
|
noErr = [fileManager copyItemAtURL:self.URL toURL:url error:outError];
|
||||||
|
if (!noErr && *outError) {
|
||||||
|
[*outError retain];
|
||||||
|
}
|
||||||
done = YES;
|
done = YES;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -620,9 +626,10 @@ static void logCallback(MP4LogLevel loglevel, const char* fmt, va_list ap)
|
|||||||
if (noErr) {
|
if (noErr) {
|
||||||
self.URL = url;
|
self.URL = url;
|
||||||
success = [self updateMP4FileWithAttributes:attributes error:outError];
|
success = [self updateMP4FileWithAttributes:attributes error:outError];
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
success = NO;
|
success = NO;
|
||||||
|
[*outError autorelease];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
self.URL = url;
|
self.URL = url;
|
||||||
|
|||||||
Reference in new issue
Block a user