Remove deprecated api.
This commit is contained in:
1 parent
982b36daf0
commit
4c2323a0c7
8 files changed
+31
-37
No files matched your search
@@ -416,7 +416,6 @@
|
||||
|
||||
_ocr = [[MP42OCRWrapper alloc] initWithLanguage:track.language extendedLanguageTag:track.extendedLanguageTag];
|
||||
|
||||
|
||||
if ([format isEqualToString:MP42SubtitleFormatVobSub]) {
|
||||
// Launch the vobsub decoder thread.
|
||||
decoderThread = [[NSThread alloc] initWithTarget:self selector:@selector(VobSubDecoderThreadMainRoutine) object:nil];
|
||||
|
||||
@@ -114,7 +114,7 @@ static int ParseByte(const char *string, UInt8 *byte, Boolean hex)
|
||||
@autoreleasepool {
|
||||
MP4TrackId trackId = self.inputTracks.lastObject.sourceId;
|
||||
|
||||
NSString *scc = STStandardizeStringNewlines(STLoadFileWithUnknownEncoding(self.fileURL.path));
|
||||
NSString *scc = STStandardizeStringNewlines(STLoadFileWithUnknownEncoding(self.fileURL));
|
||||
if (!scc) return;
|
||||
|
||||
NSScanner *sc = [NSScanner scannerWithString:scc];
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
_areChaptersEdited = YES;
|
||||
|
||||
chapters = [[NSMutableArray alloc] init];
|
||||
LoadChaptersFromPath([_sourceURL path], chapters);
|
||||
LoadChaptersFromURL(_sourceURL, chapters);
|
||||
[chapters sortUsingSelector:@selector(compare:)];
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@
|
||||
// <three>
|
||||
+ (nullable NSArray<NSArray<NSString *> *> *)arrayWithContentsOfCSVURL:(NSURL *)url;
|
||||
{
|
||||
NSString *str1 = STLoadFileWithUnknownEncoding(url.path);
|
||||
NSString *str1 = STLoadFileWithUnknownEncoding(url);
|
||||
NSMutableString *csvString = STStandardizeStringNewlines(str1);
|
||||
if (!csvString) return 0;
|
||||
|
||||
|
||||
+9
-14
@@ -1080,11 +1080,9 @@ static const genreType_t genreType_strings[] = {
|
||||
|
||||
MP4ItmfData *data = &item->dataList.elements[j];
|
||||
NSData *xmlData = [NSData dataWithBytes:data->value length:data->valueSize];
|
||||
NSDictionary *dma = (NSDictionary *)[NSPropertyListSerialization
|
||||
propertyListFromData:xmlData
|
||||
mutabilityOption:NSPropertyListMutableContainersAndLeaves
|
||||
format:nil
|
||||
errorDescription:nil];
|
||||
NSDictionary *dma = (NSDictionary *)[NSPropertyListSerialization propertyListWithData:xmlData
|
||||
options:NSPropertyListMutableContainersAndLeaves
|
||||
format:nil error:NULL];
|
||||
|
||||
NSString *tag = nil;
|
||||
|
||||
@@ -1454,11 +1452,9 @@ static const genreType_t genreType_strings[] = {
|
||||
for(j = 0; j < item->dataList.size; j++) {
|
||||
MP4ItmfData* data = &item->dataList.elements[j];
|
||||
NSData *xmlData = [NSData dataWithBytes:data->value length:data->valueSize];
|
||||
NSDictionary *dma = (NSDictionary *)[NSPropertyListSerialization
|
||||
propertyListFromData:xmlData
|
||||
mutabilityOption:NSPropertyListMutableContainersAndLeaves
|
||||
format:nil
|
||||
errorDescription:nil];
|
||||
NSDictionary *dma = (NSDictionary *)[NSPropertyListSerialization propertyListWithData:xmlData
|
||||
options:NSPropertyListMutableContainersAndLeaves
|
||||
format:nil error:NULL];
|
||||
[iTunMovi release];
|
||||
iTunMovi = [dma mutableCopy];
|
||||
}
|
||||
@@ -1509,10 +1505,9 @@ static const genreType_t genreType_strings[] = {
|
||||
[iTunMovi removeObjectForKey:@"studio"];
|
||||
}
|
||||
|
||||
NSData *serializedPlist = [NSPropertyListSerialization
|
||||
dataFromPropertyList:iTunMovi
|
||||
format:NSPropertyListXMLFormat_v1_0
|
||||
errorDescription:nil];
|
||||
NSData *serializedPlist = [NSPropertyListSerialization dataWithPropertyList:iTunMovi
|
||||
format:NSPropertyListXMLFormat_v1_0
|
||||
options:0 error:NULL];
|
||||
if (iTunMovi.count) {
|
||||
MP4ItmfItemList *moviList = MP4ItmfGetItemsByMeaning(fileHandle, "com.apple.iTunes", "iTunMOVI");
|
||||
if (moviList) {
|
||||
|
||||
@@ -93,9 +93,9 @@
|
||||
|
||||
_ss = [[SBSubSerializer alloc] init];
|
||||
if ([self.fileURL.pathExtension caseInsensitiveCompare: @"srt"] == NSOrderedSame) {
|
||||
success = LoadSRTFromPath(self.fileURL.path, _ss, &duration);
|
||||
success = LoadSRTFromURL(self.fileURL, _ss, &duration);
|
||||
} else if ([self.fileURL.pathExtension caseInsensitiveCompare: @"smi"] == NSOrderedSame) {
|
||||
success = LoadSMIFromPath(self.fileURL.path, _ss, 1);
|
||||
success = LoadSMIFromURL(self.fileURL, _ss, 1);
|
||||
}
|
||||
|
||||
[newTrack setDuration:duration];
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
@end
|
||||
|
||||
NSMutableString *STStandardizeStringNewlines(NSString *str);
|
||||
extern NSString *STLoadFileWithUnknownEncoding(NSString *path);
|
||||
int LoadSRTFromPath(NSString *path, SBSubSerializer *ss, MP4Duration *duration);
|
||||
int LoadSMIFromPath(NSString *path, SBSubSerializer *ss, int subCount);
|
||||
extern NSString *STLoadFileWithUnknownEncoding(NSURL *url);
|
||||
int LoadSRTFromURL(NSURL *url, SBSubSerializer *ss, MP4Duration *duration);
|
||||
int LoadSMIFromURL(NSURL *url, SBSubSerializer *ss, int subCount);
|
||||
|
||||
int LoadChaptersFromPath(NSString *path, NSMutableArray *ss);
|
||||
int LoadChaptersFromURL(NSURL *url, NSMutableArray *ss);
|
||||
int ParseSSAHeader(NSString *header);
|
||||
NSString *StripSSALine(NSString *line);
|
||||
|
||||
|
||||
@@ -310,9 +310,9 @@ BOOL SubDifferentiateLatin12(const unsigned char *data, int length)
|
||||
}
|
||||
|
||||
|
||||
extern NSString *STLoadFileWithUnknownEncoding(NSString *path)
|
||||
extern NSString *STLoadFileWithUnknownEncoding(NSURL *url)
|
||||
{
|
||||
NSData *data = [NSData dataWithContentsOfMappedFile:path];
|
||||
NSData *data = [NSData dataWithContentsOfURL:url];
|
||||
|
||||
if (!data)
|
||||
return nil;
|
||||
@@ -339,7 +339,7 @@ extern NSString *STLoadFileWithUnknownEncoding(NSString *path)
|
||||
}
|
||||
|
||||
if ((conf < .6 || latin2) && enc != NSASCIIStringEncoding) {
|
||||
NSLog(@"Guessed encoding \"%s\" for \"%s\", but not sure (confidence %f%%).\n",[enc_str UTF8String],[path UTF8String],conf*100.);
|
||||
NSLog(@"Guessed encoding \"%s\" for \"%s\", but not sure (confidence %f%%).\n", enc_str.UTF8String, url.path.UTF8String, conf*100.);
|
||||
}
|
||||
|
||||
res = [[[NSString alloc] initWithData:data encoding:enc] autorelease];
|
||||
@@ -385,9 +385,9 @@ static int ParseForced(NSString *str)
|
||||
return res;
|
||||
}
|
||||
|
||||
int LoadSRTFromPath(NSString *path, SBSubSerializer *ss, MP4Duration *duration)
|
||||
int LoadSRTFromURL(NSURL *url, SBSubSerializer *ss, MP4Duration *duration)
|
||||
{
|
||||
NSMutableString *srt = STStandardizeStringNewlines(STLoadFileWithUnknownEncoding(path));
|
||||
NSMutableString *srt = STStandardizeStringNewlines(STLoadFileWithUnknownEncoding(url));
|
||||
if (!srt.length) return 0;
|
||||
|
||||
if ([srt characterAtIndex:0] == 0xFEFF) [srt deleteCharactersInRange:NSMakeRange(0,1)];
|
||||
@@ -454,9 +454,9 @@ int LoadSRTFromPath(NSString *path, SBSubSerializer *ss, MP4Duration *duration)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LoadChaptersFromPath(NSString *path, NSMutableArray *ss)
|
||||
int LoadChaptersFromURL(NSURL *url, NSMutableArray *ss)
|
||||
{
|
||||
NSMutableString *srt = STStandardizeStringNewlines(STLoadFileWithUnknownEncoding(path));
|
||||
NSMutableString *srt = STStandardizeStringNewlines(STLoadFileWithUnknownEncoding(url));
|
||||
if (!srt) return 0;
|
||||
|
||||
if ([srt characterAtIndex:0] == 0xFEFF) [srt deleteCharactersInRange:NSMakeRange(0,1)];
|
||||
@@ -668,9 +668,9 @@ static NSMutableString *StandardizeSMIWhitespace(NSString *str)
|
||||
return ms;
|
||||
}
|
||||
|
||||
int LoadSMIFromPath(NSString *path, SBSubSerializer *ss, int subCount)
|
||||
int LoadSMIFromURL(NSURL *url, SBSubSerializer *ss, int subCount)
|
||||
{
|
||||
NSMutableString *smi = StandardizeSMIWhitespace(STLoadFileWithUnknownEncoding(path));
|
||||
NSMutableString *smi = StandardizeSMIWhitespace(STLoadFileWithUnknownEncoding(url));
|
||||
if (!smi) return 0;
|
||||
|
||||
NSScanner *sc = [NSScanner scannerWithString:smi];
|
||||
|
||||
@@ -124,8 +124,8 @@ static NSString *getNextVobSubLine(NSEnumerator *lineEnum)
|
||||
static NSArray<SBVobSubTrack *> * LoadVobSubSubtitles(NSURL *theDirectory, NSString *filename)
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSString *nsPath = [[theDirectory path] stringByAppendingPathComponent:filename];
|
||||
NSString *idxContent = STLoadFileWithUnknownEncoding(nsPath);
|
||||
NSURL *nsURL = [theDirectory URLByAppendingPathComponent:filename];
|
||||
NSString *idxContent = STLoadFileWithUnknownEncoding(nsURL);
|
||||
NSData *privateData = nil;
|
||||
|
||||
VobSubState state = VOB_SUB_STATE_READING_PRIVATE;
|
||||
@@ -133,11 +133,11 @@ static NSArray<SBVobSubTrack *> * LoadVobSubSubtitles(NSURL *theDirectory, NSStr
|
||||
int imageWidth = 0, imageHeight = 0;
|
||||
long delay=0;
|
||||
|
||||
NSString *subFileName = [[nsPath stringByDeletingPathExtension] stringByAppendingPathExtension:@"sub"];
|
||||
NSURL *subFileURL = [[nsURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sub"];
|
||||
|
||||
if([idxContent length]) {
|
||||
NSError *nsErr;
|
||||
NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:subFileName error:&nsErr];
|
||||
NSDictionary *attr = [[NSFileManager defaultManager] attributesOfItemAtPath:subFileURL.path error:&nsErr];
|
||||
if (!attr) goto bail;
|
||||
int subFileSize = [[attr objectForKey:NSFileSize] intValue];
|
||||
|
||||
|
||||
Reference in new issue
Block a user