Remove dead code.
This commit is contained in:
3 files changed
+6
-65
No files matched your search
@@ -24,7 +24,6 @@
|
||||
@interface MP42SSAImporter ()
|
||||
|
||||
@property (nonatomic, readonly) MP42SSAParser *parser;
|
||||
@property (nonatomic, readonly) SBSubSerializer *ss;
|
||||
|
||||
@end
|
||||
|
||||
@@ -100,17 +99,17 @@
|
||||
|
||||
MP42SSAConverter *converter = [[MP42SSAConverter alloc] initWithParser:_parser];
|
||||
|
||||
_ss = [[SBSubSerializer alloc] init];
|
||||
[_ss setSSA:YES];
|
||||
SBSubSerializer *ss = [[SBSubSerializer alloc] init];
|
||||
[ss setSSA:YES];
|
||||
|
||||
for (MP42SSALine *line in _parser.lines) {
|
||||
NSString *text = [converter convertLine:line];
|
||||
if (text.length) {
|
||||
SBSubLine *sl = [[SBSubLine alloc] initWithLine:text start:line.start end: line.end];
|
||||
[_ss addLine:sl];
|
||||
[ss addLine:sl];
|
||||
}
|
||||
}
|
||||
[_ss setFinished:YES];
|
||||
[ss setFinished:YES];
|
||||
|
||||
for (MP42SubtitleTrack *track in self.inputTracks) {
|
||||
CGSize trackSize;
|
||||
@@ -118,8 +117,8 @@
|
||||
trackSize.height = track.trackHeight;
|
||||
MP42SampleBuffer *sample;
|
||||
|
||||
while (!_ss.isEmpty && !self.isCancelled) {
|
||||
SBSubLine *sl = [_ss getSerializedPacket];
|
||||
while (!ss.isEmpty && !self.isCancelled) {
|
||||
SBSubLine *sl = [ss getSerializedPacket];
|
||||
|
||||
if ([sl->line isEqualToString:@"\n"]) {
|
||||
sample = copyEmptySubtitleSample(track.sourceId, sl->end_time - sl->begin_time, NO);
|
||||
|
||||
@@ -54,7 +54,6 @@ int LoadSRTFromURL(NSURL *url, SBSubSerializer *ss, MP4Duration *duration);
|
||||
int LoadSMIFromURL(NSURL *url, SBSubSerializer *ss, int subCount);
|
||||
|
||||
int LoadChaptersFromURL(NSURL *url, NSMutableArray *ss);
|
||||
NSString *StripSSALine(NSString *line);
|
||||
|
||||
unsigned ParseSubTime(const char *time, unsigned secondScale, BOOL hasSign);
|
||||
|
||||
|
||||
@@ -806,63 +806,6 @@ int LoadSMIFromURL(NSURL *url, SBSubSerializer *ss, int subCount)
|
||||
return 1;
|
||||
}
|
||||
|
||||
NSString * StripSSALine(NSString *line)
|
||||
{
|
||||
NSUInteger i = 0;
|
||||
|
||||
NSScanner *sc = [NSScanner scannerWithString:line];
|
||||
for (i = 0; i < 8; i++) {
|
||||
[sc scanUpToString:@"," intoString:nil];
|
||||
[sc scanString:@"," intoString:nil];
|
||||
}
|
||||
|
||||
line = [sc.string substringFromIndex:sc.scanLocation];
|
||||
|
||||
NSRange startRange = [line rangeOfString: @"}"];
|
||||
while (startRange.location != NSNotFound) {
|
||||
NSRange endRange = [line rangeOfString: @"{"];
|
||||
if (endRange.location != NSNotFound && endRange.length != 0) {
|
||||
NSString *replacement = @"";
|
||||
if (endRange.location + 3 < line.length) {
|
||||
unichar tag = [line characterAtIndex:endRange.location + 2];
|
||||
unichar tagState = [line characterAtIndex:endRange.location + 3];
|
||||
if (tagState == '1') {
|
||||
if (tag == 'i') replacement = @"<i>";
|
||||
else if (tag == 'b') replacement = @"<b>";
|
||||
else if (tag == 'u') replacement = @"<u>";
|
||||
}
|
||||
else if (tagState == '0'){
|
||||
if (tag == 'i') replacement = @"</i>";
|
||||
else if (tag == 'b') replacement = @"</b>";
|
||||
else if (tag == 'u') replacement = @"</u>";
|
||||
}
|
||||
}
|
||||
endRange.length = startRange.location - endRange.location +1;
|
||||
line = [line stringByReplacingCharactersInRange:endRange withString:replacement];
|
||||
startRange = [line rangeOfString: @"}"];
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
startRange = [line rangeOfString: @"\\N"];
|
||||
while (startRange.location != NSNotFound) {
|
||||
startRange.length = 2;
|
||||
line = [line stringByReplacingCharactersInRange:startRange withString:@"\n"];
|
||||
startRange = [line rangeOfString: @"\\N"];
|
||||
}
|
||||
|
||||
startRange = [line rangeOfString: @"\\n"];
|
||||
while (startRange.location != NSNotFound) {
|
||||
startRange.length = 2;
|
||||
line = [line stringByReplacingCharactersInRange:startRange withString:@"\n"];
|
||||
startRange = [line rangeOfString: @"\\n"];
|
||||
}
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
u_int8_t* createStyleRecord(u_int16_t startChar, u_int16_t endChar, u_int16_t fontID, u_int8_t flags, rgba_color color, u_int8_t* style)
|
||||
{
|
||||
style[0] = (startChar >> 8) & 0xff; // startChar
|
||||
|
||||
Reference in new issue
Block a user