Changeset 1022

Show
Ignore:
Timestamp:
10/21/07 12:37:08 (15 months ago)
Author:
stephen_booth
Message:

Cleaned up

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Audio/Properties/OggVorbisPropertiesReader.m

    r731 r1022  
    2828 
    2929- (BOOL) readProperties:(NSError **)error 
    30 { 
    31         NSMutableDictionary                             *propertiesDictionary; 
    32         NSString                                                *path; 
    33         OggVorbis_File                                  vf; 
    34         vorbis_info                                             *ovInfo; 
    35         FILE                                                    *file; 
    36         int                                                             result; 
    37         ogg_int64_t                                             totalFrames; 
    38         long                                                    bitrate; 
    39          
    40         path                                                    = [[self valueForKey:StreamURLKey] path]; 
    41         file                                                    = fopen([path fileSystemRepresentation], "r"); 
     30{        
     31        NSString        *path           = [[self valueForKey:StreamURLKey] path]; 
     32        FILE            *file           = fopen([path fileSystemRepresentation], "r"); 
    4233         
    4334        if(NULL == file) { 
     
    5748        } 
    5849         
    59         result                                                  = ov_test(file, &vf, NULL, 0); 
     50        OggVorbis_File vf; 
     51        int result = ov_test(file, &vf, NULL, 0); 
    6052         
    6153        if(0 != result) { 
     
    8274         
    8375        // Get input file information 
    84         ovInfo = ov_info(&vf, -1); 
     76        vorbis_info *ovInfo = ov_info(&vf, -1); 
    8577        NSAssert(NULL != ovInfo, @"Unable to get information on Ogg Vorbis stream."); 
    8678         
    87         totalFrames                             = ov_pcm_total(&vf, -1); 
    88         bitrate                                 = ov_bitrate(&vf, -1); 
     79        ogg_int64_t                             totalFrames                             = ov_pcm_total(&vf, -1); 
     80        long                                    bitrate                                 = ov_bitrate(&vf, -1); 
    8981         
    90         propertiesDictionary    = [NSMutableDictionary dictionary]; 
     82        NSMutableDictionary             *propertiesDictionary   = [NSMutableDictionary dictionary]; 
    9183         
    9284        [propertiesDictionary setValue:NSLocalizedStringFromTable(@"Ogg", @"Formats", @"") forKey:PropertiesFileTypeKey]; 
     
    9587        [propertiesDictionary setValue:[NSNumber numberWithLongLong:totalFrames] forKey:PropertiesTotalFramesKey]; 
    9688        [propertiesDictionary setValue:[NSNumber numberWithLong:bitrate] forKey:PropertiesBitrateKey]; 
    97         //      [propertiesDictionary setValue:[NSNumber numberWithUnsignedInt:16] forKey:PropertiesBitsPerChannelKey]; 
     89//      [propertiesDictionary setValue:[NSNumber numberWithUnsignedInt:16] forKey:PropertiesBitsPerChannelKey]; 
    9890        [propertiesDictionary setValue:[NSNumber numberWithUnsignedInt:ovInfo->channels] forKey:PropertiesChannelsPerFrameKey]; 
    9991        [propertiesDictionary setValue:[NSNumber numberWithUnsignedInt:ovInfo->rate] forKey:PropertiesSampleRateKey]; 
    10092        [propertiesDictionary setValue:[NSNumber numberWithDouble:(double)totalFrames / ovInfo->rate] forKey:PropertiesDurationKey]; 
    101                  
    10293         
    10394        [self setValue:propertiesDictionary forKey:@"properties"];