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