Use ARC where possible.
This commit is contained in:
1 parent
0bef381148
commit
b841840561
13 files changed
+123
-207
No files matched your search
@@ -197,13 +197,6 @@ extern u_int8_t MP4AV_AacConfigGetChannels(u_int8_t* pConfig);
|
||||
return (_trackId > 0);
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_mixdownType release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setVolume:(float)newVolume
|
||||
{
|
||||
_volume = newVolume;
|
||||
@@ -280,7 +273,7 @@ extern u_int8_t MP4AV_AacConfigGetChannels(u_int8_t* pConfig);
|
||||
|
||||
_fallbackTrackId = [decoder decodeInt64ForKey:@"fallbackTrackId"];
|
||||
|
||||
_mixdownType = [[decoder decodeObjectOfClass:[NSString class] forKey:@"mixdownType"] retain];
|
||||
_mixdownType = [decoder decodeObjectOfClass:[NSString class] forKey:@"mixdownType"];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
+9
-17
@@ -59,9 +59,9 @@
|
||||
|
||||
char *title = chapter_list[i-1].title;
|
||||
if ((title[0] == '\xfe' && title[1] == '\xff') || (title[0] == '\xff' && title[1] == '\xfe')) {
|
||||
chapter.title = [[[NSString alloc] initWithBytes:title
|
||||
length:chapter_list[i-1].titleLength
|
||||
encoding:NSUTF16StringEncoding] autorelease];
|
||||
chapter.title = [[NSString alloc] initWithBytes:title
|
||||
length:chapter_list[i-1].titleLength
|
||||
encoding:NSUTF16StringEncoding];
|
||||
} else {
|
||||
chapter.title = [NSString stringWithCString:chapter_list[i-1].title encoding: NSUTF8StringEncoding];
|
||||
}
|
||||
@@ -69,7 +69,6 @@
|
||||
chapter.timestamp = sum;
|
||||
sum = chapter_list[i-1].duration + sum;
|
||||
[chapters addObject:chapter];
|
||||
[chapter release];
|
||||
i++;
|
||||
}
|
||||
MP4Free(chapter_list);
|
||||
@@ -82,7 +81,7 @@
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
_format = kMP42SubtitleCodecType_Text;
|
||||
_sourceURL = [URL retain];
|
||||
_sourceURL = URL;
|
||||
_language = @"English";
|
||||
_isEdited = YES;
|
||||
_muxed = NO;
|
||||
@@ -100,7 +99,7 @@
|
||||
|
||||
+ (instancetype)chapterTrackFromFile:(NSURL *)URL
|
||||
{
|
||||
return [[[MP42ChapterTrack alloc] initWithTextFile:URL] autorelease];
|
||||
return [[MP42ChapterTrack alloc] initWithTextFile:URL];
|
||||
}
|
||||
|
||||
- (NSString *)defaultName {
|
||||
@@ -125,7 +124,6 @@
|
||||
newChapter.timestamp = timestamp;
|
||||
|
||||
NSUInteger idx = [self addChapter:newChapter];
|
||||
[newChapter release];
|
||||
|
||||
return idx;
|
||||
}
|
||||
@@ -137,7 +135,6 @@
|
||||
newChapter.timestamp = timestamp;
|
||||
|
||||
NSUInteger idx = [self addChapter:newChapter];
|
||||
[newChapter release];
|
||||
|
||||
return idx;
|
||||
}
|
||||
@@ -210,7 +207,6 @@
|
||||
st.timestamp = 0;
|
||||
st.title = @"Chapter 0";
|
||||
[chapters insertObject:st atIndex:0];
|
||||
[st release];
|
||||
chapterCount++;
|
||||
}
|
||||
|
||||
@@ -273,7 +269,7 @@
|
||||
|
||||
- (BOOL)exportToURL:(NSURL *)url error:(NSError **)error
|
||||
{
|
||||
NSMutableString* file = [[[NSMutableString alloc] init] autorelease];
|
||||
NSMutableString* file = [[NSMutableString alloc] init];
|
||||
NSUInteger x = 0;
|
||||
|
||||
for (MP42TextSample * chapter in chapters) {
|
||||
@@ -321,17 +317,13 @@
|
||||
{
|
||||
self = [super initWithCoder:decoder];
|
||||
|
||||
chapters = [[decoder decodeObjectOfClass:[NSMutableArray class] forKey:@"chapters"] retain];
|
||||
if (self) {
|
||||
chapters = [decoder decodeObjectOfClass:[NSMutableArray class] forKey:@"chapters"];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[chapters release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSArray (CSVAdditions)
|
||||
|
||||
@@ -44,9 +44,4 @@
|
||||
return (_trackId > 0);
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -60,7 +60,6 @@
|
||||
}
|
||||
|
||||
- (void)addSample:(MP42SampleBuffer *)sample {
|
||||
[sample retain];
|
||||
|
||||
if (sample->attachments) {
|
||||
// Flush the current queue, because pts time is going to be reset
|
||||
@@ -75,7 +74,6 @@
|
||||
if ([_priorityQueue isFull]) {
|
||||
MP42SampleBuffer *extractedSample = [_priorityQueue extract];
|
||||
[self analyzeSample:extractedSample];
|
||||
[extractedSample release];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +82,6 @@
|
||||
while (!_priorityQueue.isEmpty) {
|
||||
MP42SampleBuffer *extractedSample = [_priorityQueue extract];
|
||||
[self analyzeSample:extractedSample];
|
||||
[extractedSample release];
|
||||
}
|
||||
|
||||
if (_editOpen == YES) {
|
||||
@@ -214,9 +211,4 @@
|
||||
_editOpen = NO;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[_priorityQueue release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
+2
-17
@@ -186,7 +186,6 @@ int compare_color(rgba_color c1, rgba_color c2) {
|
||||
|
||||
if (style) {
|
||||
[_styles addObject:style];
|
||||
[style release];
|
||||
}
|
||||
|
||||
[_text deleteCharactersInRange:contentRange];
|
||||
@@ -204,7 +203,7 @@ int compare_color(rgba_color c1, rgba_color c2) {
|
||||
currentStyle.length = nextStyle.location - currentStyle.location;
|
||||
if (currentStyle.style || compare_color(currentStyle.color, nextStyle.color)) {
|
||||
if (currentStyle.length) {
|
||||
[serializedStyles addObject:[[currentStyle copy] autorelease]];
|
||||
[serializedStyles addObject:[currentStyle copy]];
|
||||
}
|
||||
}
|
||||
currentStyle.location = nextStyle.location;
|
||||
@@ -231,25 +230,11 @@ int compare_color(rgba_color c1, rgba_color c2) {
|
||||
if (currentStyle.style || compare_color(currentStyle.color, _defaultColor)) {
|
||||
currentStyle.length = _text.length - currentStyle.location;
|
||||
if (currentStyle.length) {
|
||||
[serializedStyles addObject:[[currentStyle copy] autorelease]];
|
||||
[serializedStyles addObject:[currentStyle copy]];
|
||||
}
|
||||
}
|
||||
|
||||
[currentStyle release];
|
||||
[_styles release];
|
||||
_styles = serializedStyles;
|
||||
}
|
||||
|
||||
@synthesize text = _text;
|
||||
@synthesize styles = _styles;
|
||||
@synthesize defaultColor = _defaultColor;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_text release];
|
||||
[_styles release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -634,10 +634,9 @@ iso639_lang_t * lang_for_english( const char * english )
|
||||
[languagesArray insertObject:lang atIndex:0];
|
||||
}
|
||||
_languagesArray = [languagesArray copy];
|
||||
[languagesArray release];
|
||||
}
|
||||
|
||||
return [[_languagesArray copy] autorelease];
|
||||
return [_languagesArray copy];
|
||||
}
|
||||
|
||||
- (NSArray<NSString *> *)iso6391languages {
|
||||
@@ -656,10 +655,9 @@ iso639_lang_t * lang_for_english( const char * english )
|
||||
[languagesArray insertObject:lang atIndex:0];
|
||||
}
|
||||
_iso6391languagesArray = [languagesArray copy];
|
||||
[languagesArray release];
|
||||
}
|
||||
|
||||
return [[_iso6391languagesArray copy] autorelease];
|
||||
return [_iso6391languagesArray copy];
|
||||
}
|
||||
|
||||
+ (NSString *)iso6391CodeFor:(NSString *)aLanguage {
|
||||
|
||||
@@ -144,8 +144,6 @@ protected:
|
||||
OCRWrapper *ocr = (OCRWrapper *)tess_base;
|
||||
ocr->End();
|
||||
delete ocr;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
+39
-45
@@ -15,9 +15,6 @@
|
||||
NSMutableArray<NSString *> *iTunesCodes;
|
||||
}
|
||||
|
||||
@synthesize ratings;
|
||||
@synthesize iTunesCodes;
|
||||
|
||||
+ (MP42Ratings *) defaultManager {
|
||||
static dispatch_once_t sharedRatingsPred;
|
||||
static MP42Ratings *sharedRatingsManager = nil;
|
||||
@@ -29,54 +26,18 @@
|
||||
if (self = [super init]) {
|
||||
NSString *ratingsJSON = [[NSBundle bundleForClass:[MP42Ratings class]] pathForResource:@"Ratings" ofType:@"json"];
|
||||
if (!ratingsJSON) {
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *data = [NSData dataWithContentsOfFile:ratingsJSON];
|
||||
|
||||
if (data) {
|
||||
ratingsDictionary = [[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil] retain];
|
||||
ratingsDictionary = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
|
||||
} else {
|
||||
ratingsDictionary = [[NSMutableArray alloc] init];
|
||||
}
|
||||
|
||||
// construct movie ratings
|
||||
ratings = [[NSMutableArray alloc] init];
|
||||
iTunesCodes = [[NSMutableArray alloc] init];
|
||||
|
||||
// if a specific country is picked, include the USA ratings at the end
|
||||
NSString *selectedCountry = [[NSUserDefaults standardUserDefaults] valueForKey:@"SBRatingsCountry"];
|
||||
NSDictionary *usaRatings = nil;
|
||||
|
||||
for (NSDictionary *countryRatings in ratingsDictionary) {
|
||||
NSString *countryName = [countryRatings valueForKey:@"country"];
|
||||
|
||||
if ([countryName isEqualToString:@"USA"]) {
|
||||
usaRatings = countryRatings;
|
||||
}
|
||||
|
||||
if (![selectedCountry isEqualToString:@"All countries"]) {
|
||||
if (![countryName isEqualToString:@"Unknown"] && ![countryName isEqualToString:selectedCountry]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (NSDictionary *rating in [countryRatings valueForKey:@"ratings"]) {
|
||||
[ratings addObject:[NSString stringWithFormat:@"%@ %@: %@", countryName, [rating valueForKey:@"media"], [rating valueForKey:@"description"]]];
|
||||
[iTunesCodes addObject:[NSString stringWithFormat:@"%@|%@|%@|", [rating valueForKey:@"prefix"], [rating valueForKey:@"itunes-code"], [rating valueForKey:@"itunes-value"]]];
|
||||
}
|
||||
}
|
||||
|
||||
if (![selectedCountry isEqualToString:@"All countries"] && ![selectedCountry isEqualToString:@"USA"]) {
|
||||
if (usaRatings) {
|
||||
for (NSDictionary *rating in [usaRatings valueForKey:@"ratings"]) {
|
||||
[ratings addObject:[NSString stringWithFormat:@"%@ %@: %@", @"USA", [rating valueForKey:@"media"], [rating valueForKey:@"description"]]];
|
||||
[iTunesCodes addObject:[NSString stringWithFormat:@"%@|%@|%@|", [rating valueForKey:@"prefix"], [rating valueForKey:@"itunes-code"], [rating valueForKey:@"itunes-value"]]];
|
||||
}
|
||||
}
|
||||
}
|
||||
[self updateRatingsCountry];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -91,13 +52,46 @@
|
||||
[countries addObject:countryName];
|
||||
}
|
||||
}
|
||||
return [countries autorelease];
|
||||
return countries;
|
||||
}
|
||||
|
||||
- (void)updateRatingsCountry {
|
||||
[ratings release];
|
||||
[iTunesCodes release];
|
||||
[self init];
|
||||
// construct movie ratings
|
||||
ratings = [[NSMutableArray alloc] init];
|
||||
iTunesCodes = [[NSMutableArray alloc] init];
|
||||
|
||||
// if a specific country is picked, include the USA ratings at the end
|
||||
NSString *selectedCountry = [[NSUserDefaults standardUserDefaults] valueForKey:@"SBRatingsCountry"];
|
||||
NSDictionary *usaRatings = nil;
|
||||
|
||||
for (NSDictionary *countryRatings in ratingsDictionary) {
|
||||
NSString *countryName = [countryRatings valueForKey:@"country"];
|
||||
|
||||
if ([countryName isEqualToString:@"USA"]) {
|
||||
usaRatings = countryRatings;
|
||||
}
|
||||
|
||||
if (![selectedCountry isEqualToString:@"All countries"]) {
|
||||
if (![countryName isEqualToString:@"Unknown"] && ![countryName isEqualToString:selectedCountry]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (NSDictionary *rating in [countryRatings valueForKey:@"ratings"]) {
|
||||
[ratings addObject:[NSString stringWithFormat:@"%@ %@: %@", countryName, [rating valueForKey:@"media"], [rating valueForKey:@"description"]]];
|
||||
[iTunesCodes addObject:[NSString stringWithFormat:@"%@|%@|%@|", [rating valueForKey:@"prefix"], [rating valueForKey:@"itunes-code"], [rating valueForKey:@"itunes-value"]]];
|
||||
}
|
||||
}
|
||||
|
||||
if (![selectedCountry isEqualToString:@"All countries"] && ![selectedCountry isEqualToString:@"USA"]) {
|
||||
if (usaRatings) {
|
||||
for (NSDictionary *rating in [usaRatings valueForKey:@"ratings"]) {
|
||||
[ratings addObject:[NSString stringWithFormat:@"%@ %@: %@", @"USA", [rating valueForKey:@"media"], [rating valueForKey:@"description"]]];
|
||||
[iTunesCodes addObject:[NSString stringWithFormat:@"%@|%@|%@|", [rating valueForKey:@"prefix"], [rating valueForKey:@"itunes-code"], [rating valueForKey:@"itunes-value"]]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *) ratings {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
- (void)dealloc {
|
||||
free(data);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
+14
-31
@@ -24,15 +24,9 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
[lines release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
static CFComparisonResult CompareLinesByBeginTime(const void *a, const void *b, void *unused)
|
||||
{
|
||||
SBSubLine *al = (SBSubLine*)a, *bl = (SBSubLine*)b;
|
||||
SBSubLine *al = (__bridge SBSubLine*)a, *bl = (__bridge SBSubLine*)b;
|
||||
|
||||
if (al->begin_time > bl->begin_time) return kCFCompareGreaterThan;
|
||||
if (al->begin_time < bl->begin_time) return kCFCompareLessThan;
|
||||
@@ -57,7 +51,7 @@ static CFComparisonResult CompareLinesByBeginTime(const void *a, const void *b,
|
||||
if (!nlines || line->begin_time > ((SBSubLine*)[lines objectAtIndex:nlines-1])->begin_time) {
|
||||
[lines addObject:line];
|
||||
} else {
|
||||
CFIndex i = CFArrayBSearchValues((CFArrayRef)lines, CFRangeMake(0, nlines), line, CompareLinesByBeginTime, NULL);
|
||||
CFIndex i = CFArrayBSearchValues((CFArrayRef)lines, CFRangeMake(0, nlines), (__bridge const void *)(line), CompareLinesByBeginTime, NULL);
|
||||
|
||||
if (i >= nlines)
|
||||
[lines addObject:line];
|
||||
@@ -126,7 +120,7 @@ canOutput:
|
||||
}
|
||||
}
|
||||
|
||||
return [[[SBSubLine alloc] initWithLine:str start:begin_time end:end_time top_pos:top_pos forced:frcd] autorelease];
|
||||
return [[SBSubLine alloc] initWithLine:str start:begin_time end:end_time top_pos:top_pos forced:frcd];
|
||||
}
|
||||
|
||||
-(SBSubLine*)getSerializedPacket
|
||||
@@ -138,7 +132,7 @@ canOutput:
|
||||
SBSubLine *nextline = [lines objectAtIndex:0], *ret;
|
||||
|
||||
if (nextline->begin_time > last_end_time) {
|
||||
ret = [[[SBSubLine alloc] initWithLine:@"\n" start:last_end_time end:nextline->begin_time] autorelease];
|
||||
ret = [[SBSubLine alloc] initWithLine:@"\n" start:last_end_time end:nextline->begin_time];
|
||||
} else {
|
||||
ret = [self getNextRealSerializedPacket];
|
||||
}
|
||||
@@ -195,11 +189,11 @@ canOutput:
|
||||
|
||||
@implementation SBSubLine
|
||||
|
||||
-(instancetype)initWithLine:(NSString*)l start:(unsigned)s end:(unsigned)e
|
||||
-(instancetype)initWithLine:(NSString *)l start:(unsigned)s end:(unsigned)e
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
if ([l characterAtIndex:[l length]-1] != '\n') l = [l stringByAppendingString:@"\n"];
|
||||
line = [l retain];
|
||||
line = l;
|
||||
begin_time = s;
|
||||
end_time = e;
|
||||
no = 0;
|
||||
@@ -218,12 +212,6 @@ canOutput:
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
[line release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
-(NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"\"%@\", from %d s to %d s",[line substringToIndex:[line length]-1],begin_time,end_time];
|
||||
@@ -337,20 +325,19 @@ extern NSString *STLoadFileWithUnknownEncoding(NSURL *url)
|
||||
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];
|
||||
|
||||
if (!res) {
|
||||
if (latin2) {
|
||||
NSLog(@"Encoding %s failed, retrying.\n",[enc_str UTF8String]);
|
||||
enc = (enc == NSWindowsCP1252StringEncoding) ? NSWindowsCP1250StringEncoding : NSWindowsCP1252StringEncoding;
|
||||
res = [[[NSString alloc] initWithData:data encoding:enc] autorelease];
|
||||
res = [[NSString alloc] initWithData:data encoding:enc];
|
||||
if (!res) NSLog(@"Both of latin1/2 failed.\n");
|
||||
} else {
|
||||
res = [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
|
||||
res = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
|
||||
if (!res) NSLog(@"ASCII failed."), NSLog(@"Failed to load file as guessed encoding %@.",enc_str);
|
||||
}
|
||||
}
|
||||
[ud release];
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -432,7 +419,7 @@ int LoadSRTFromURL(NSURL *url, SBSubSerializer *ss, MP4Duration *duration)
|
||||
[sc scanUpToString:@"\n\n" intoString:&res];
|
||||
[sc scanString:@"\n\n" intoString:nil];
|
||||
SBSubLine *sl = [[SBSubLine alloc] initWithLine:res start:startTime end:endTime top_pos:position forced:forced];
|
||||
[ss addLine:[sl autorelease]];
|
||||
[ss addLine:sl];
|
||||
state = INITIAL;
|
||||
break;
|
||||
};
|
||||
@@ -494,7 +481,6 @@ int LoadChaptersFromURL(NSURL *url, NSMutableArray *ss)
|
||||
[ss addObject:chapter];
|
||||
count++;
|
||||
|
||||
[chapter release];
|
||||
state = TIMESTAMP;
|
||||
break;
|
||||
};
|
||||
@@ -524,7 +510,6 @@ int LoadChaptersFromURL(NSURL *url, NSMutableArray *ss)
|
||||
[ss addObject:chapter];
|
||||
count++;
|
||||
|
||||
[chapter release];
|
||||
state = TIMESTAMP;
|
||||
break;
|
||||
};
|
||||
@@ -710,7 +695,7 @@ int LoadSMIFromURL(NSURL *url, SBSubSerializer *ss, int subCount)
|
||||
[cmt insertString:@"{\\an8}" atIndex:0];
|
||||
if ((subCount == 1 && cc == 1) || (subCount == 2 && cc == 2)) {
|
||||
SBSubLine *sl = [[SBSubLine alloc] initWithLine:cmt start:startTime end:endTime];
|
||||
[ss addLine:[sl autorelease]];
|
||||
[ss addLine:sl];
|
||||
}
|
||||
}
|
||||
startTime = syncTime;
|
||||
@@ -950,13 +935,11 @@ NSString* createStyleAtomForString(NSString* string, u_int8_t** buffer, size_t *
|
||||
styleCount++;
|
||||
}
|
||||
|
||||
if (styleCount)
|
||||
if (styleCount) {
|
||||
*size = closeStyleAtom(styleCount, *buffer);
|
||||
}
|
||||
|
||||
string = [parser.text retain];
|
||||
[parser release];
|
||||
|
||||
return [string autorelease];
|
||||
return parser.text;
|
||||
}
|
||||
|
||||
NSString* removeNewLines(NSString* string) {
|
||||
|
||||
@@ -263,7 +263,7 @@ static void insertTagsFromStyleRecord(style_record record, NSMutableString *samp
|
||||
uint32_t timeScale = MP4GetTrackTimeScale(fileHandle, srcTrackId);
|
||||
uint64_t samples = MP4GetTrackNumberOfSamples(fileHandle, srcTrackId);
|
||||
|
||||
NSMutableString *srtFile = [[[NSMutableString alloc] init] autorelease];
|
||||
NSMutableString *srtFile = [[NSMutableString alloc] init];
|
||||
|
||||
uint64_t r, g, b, a;
|
||||
MP4GetTrackIntegerProperty(fileHandle, srcTrackId, "mdia.minf.stbl.stsd.tx3g.fontColorRed", &r);
|
||||
@@ -296,9 +296,9 @@ static void insertTagsFromStyleRecord(style_record record, NSMutableString *samp
|
||||
NSUInteger textSampleLength = ((pBytes[0] << 8) & 0xff00) + pBytes[1];
|
||||
|
||||
if (textSampleLength) {
|
||||
sampleText = [[[NSMutableString alloc] initWithBytes:(pBytes + 2)
|
||||
length:textSampleLength
|
||||
encoding:NSUTF8StringEncoding] autorelease];
|
||||
sampleText = [[NSMutableString alloc] initWithBytes:(pBytes + 2)
|
||||
length:textSampleLength
|
||||
encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
// Let's see if there is an atom after the text sample
|
||||
@@ -452,9 +452,4 @@ static void insertTagsFromStyleRecord(style_record record, NSMutableString *samp
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -26,7 +26,6 @@
|
||||
if ([nodes count] == 1)
|
||||
[self metadata2:_mMetadata forNode:[nodes objectAtIndex:0]];
|
||||
}
|
||||
[xml release];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -37,7 +36,7 @@
|
||||
NSError *err;
|
||||
NSArray *tag = [node nodesForXPath:query error:&err];
|
||||
if ([tag count]) {
|
||||
NSMutableArray *elements = [[[NSMutableArray alloc] initWithCapacity:[tag count]] autorelease];
|
||||
NSMutableArray *elements = [[NSMutableArray alloc] initWithCapacity:tag.count];
|
||||
NSEnumerator *tagEnum = [tag objectEnumerator];
|
||||
NSXMLNode *element;
|
||||
while ((element = [tagEnum nextObject])) {
|
||||
@@ -122,11 +121,4 @@
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_mMetadata release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user