Fixed some static analyizer warnings.
This commit is contained in:
1 parent
a7131d300c
commit
64163973f3
8 files changed
+25
-16
No files matched your search
@@ -589,10 +589,9 @@
|
||||
- (NSUInteger)timescaleForTrack:(MP42Track *)track {
|
||||
AVAssetTrack *assetTrack = [_localAsset trackWithTrackID:[track sourceId]];
|
||||
|
||||
CMFormatDescriptionRef formatDescription = NULL;
|
||||
NSArray *formatDescriptions = assetTrack.formatDescriptions;
|
||||
if ([formatDescriptions count] > 0)
|
||||
formatDescription = (CMFormatDescriptionRef)[formatDescriptions objectAtIndex:0];
|
||||
CMFormatDescriptionRef formatDescription = (CMFormatDescriptionRef) formatDescriptions.firstObject;
|
||||
if (formatDescriptions) {
|
||||
if ([[assetTrack mediaType] isEqualToString:AVMediaTypeAudio]) {
|
||||
const AudioStreamBasicDescription* const asbd =
|
||||
CMAudioFormatDescriptionGetStreamBasicDescription(formatDescription);
|
||||
@@ -600,6 +599,7 @@
|
||||
double sampleRate = asbd->mSampleRate;
|
||||
|
||||
return (NSUInteger)sampleRate;
|
||||
}
|
||||
}
|
||||
|
||||
return [assetTrack naturalTimeScale];
|
||||
|
||||
@@ -41,7 +41,7 @@ struct AudioFileIO
|
||||
UInt32 numPacketsPerRead;
|
||||
|
||||
AudioStreamBasicDescription srcFormat;
|
||||
AudioStreamPacketDescription *pktDescs;
|
||||
AudioStreamPacketDescription * _Nullable pktDescs;
|
||||
|
||||
MP42Fifo<MP42SampleBuffer *> *inputSamplesBuffer;
|
||||
|
||||
|
||||
+2
-2
@@ -543,7 +543,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
||||
#endif
|
||||
|
||||
if (tempURL) {
|
||||
tempURL = [tempURL URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.tmp", [self.URL lastPathComponent]]];
|
||||
tempURL = [tempURL URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.tmp", self.URL.lastPathComponent]];
|
||||
}
|
||||
|
||||
return tempURL;
|
||||
@@ -568,7 +568,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
||||
|
||||
// Loop to check the progress
|
||||
while (!done) {
|
||||
unsigned long long fileSize = [[[fileManager attributesOfItemAtPath:self.tempURL.path error:nil] valueForKey:NSFileSize] unsignedLongLongValue];
|
||||
unsigned long long fileSize = [[[fileManager attributesOfItemAtPath:tempURL.path error:nil] valueForKey:NSFileSize] unsignedLongLongValue];
|
||||
[self progressStatus:((double)fileSize / originalFileSize) * 100];
|
||||
usleep(450000);
|
||||
}
|
||||
|
||||
+7
-2
@@ -1034,13 +1034,18 @@ static const genreType_t genreType_strings[] = {
|
||||
[ratingString release];
|
||||
|
||||
if (ratingItems.count > 2) {
|
||||
ratingiTunesCode = [[NSString stringWithFormat:@"%@|%@|%@|",ratingItems[0], ratingItems[1], ratingItems[2]] retain];
|
||||
ratingiTunesCode = [[NSString stringWithFormat:@"%@|%@|%@|", ratingItems[0], ratingItems[1], ratingItems[2]] retain];
|
||||
}
|
||||
else {
|
||||
ratingiTunesCode = nil;
|
||||
}
|
||||
|
||||
[tagsDict setObject:[NSNumber numberWithUnsignedInteger:[[MP42Ratings defaultManager] ratingIndexForiTunesCode:ratingiTunesCode]] forKey:@"Rating"];
|
||||
if (ratingiTunesCode) {
|
||||
tagsDict[@"Rating"] = [NSNumber numberWithUnsignedInteger:[[MP42Ratings defaultManager] ratingIndexForiTunesCode:ratingiTunesCode]];
|
||||
}
|
||||
else {
|
||||
tagsDict[@"Rating"] = @(0);
|
||||
}
|
||||
|
||||
if (ratingItems.count >= 4) {
|
||||
tagsDict[@"Rating Annotation"] = ratingItems[3];
|
||||
|
||||
@@ -800,7 +800,7 @@
|
||||
SoundDescriptionHandle sndDesc = (SoundDescriptionHandle) desc;
|
||||
|
||||
ByteCount formatDescSize;
|
||||
AudioStreamBasicDescription formatDesc;
|
||||
AudioStreamBasicDescription formatDesc = {0};
|
||||
|
||||
err = QTSoundDescriptionGetPropertyInfo(sndDesc, kQTPropertyClass_SoundDescription,
|
||||
kQTSoundDescriptionPropertyID_AudioStreamBasicDescription,
|
||||
|
||||
+9
-5
@@ -108,11 +108,15 @@
|
||||
}
|
||||
|
||||
- (NSUInteger) ratingIndexForiTunesCode:(NSString *)aiTunesCode {
|
||||
for (NSUInteger i = 0; i < [iTunesCodes count]; i++) {
|
||||
if ([[iTunesCodes objectAtIndex:i] isEqualToString:aiTunesCode]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
NSUInteger i = 0;
|
||||
|
||||
for (NSString *code in iTunesCodes) {
|
||||
if ([code isEqualToString:aiTunesCode]) {
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return [self unknownIndex];
|
||||
}
|
||||
|
||||
|
||||
@@ -868,7 +868,7 @@
|
||||
A9B9C1E4182391DF00416A4E /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0720;
|
||||
LastUpgradeCheck = 0730;
|
||||
ORGANIZATIONNAME = "Damiano Galassi";
|
||||
TargetAttributes = {
|
||||
A9B9C203182391DF00416A4E = {
|
||||
|
||||
@@ -449,7 +449,7 @@
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0720;
|
||||
LastUpgradeCheck = 0730;
|
||||
};
|
||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "UniversalDetector" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
|
||||
Reference in new issue
Block a user