Changeset 5493

Show
Ignore:
Timestamp:
05/03/08 22:50:40 (2 weeks ago)
Author:
morris
Message:

If there are unloaded tracks when we attempt to get a listing of subtitle/audio tracks or changing the tracks, load them before in case the MKV importer has reached them since we started loading the movie

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Spiral/trunk/SPMovieController.h

    r5481 r5493  
    106106        BOOL                                                    _disablePlayingWhenOpened; 
    107107        BOOL                                                    _startPlayingWhenTracksAreLoaded; 
     108        BOOL                                                    _hasUnloadedTracks; 
    108109} 
    109110 
  • Spiral/trunk/SPMovieController.m

    r5486 r5493  
    142142        [_subtitleTracks removeAllObjects]; 
    143143         
     144        _hasUnloadedTracks = NO; 
    144145        _audioTrack = _subtitleTrack = 0; 
    145146        audioIndex = subtitleIndex = 1; 
     
    147148        for(track in [_movie tracks]) { 
    148149                type = [track attributeForKey:QTTrackMediaTypeAttribute]; 
    149                 format = [track attributeForKey:@"QTTrackFormatSummaryAttribute"]; 
     150                format = [track attributeForKey:QTTrackFormatSummaryAttribute]; 
     151                 
     152                if(!format && ![type isEqualToString:QTMediaTypeBase]) 
     153                        _hasUnloadedTracks = YES; 
    150154                 
    151155                if([type isEqualToString:QTMediaTypeSound]) { 
     
    943947 
    944948- (NSArray *)audioTracks { 
     949        if(_hasUnloadedTracks) 
     950                [self _loadTracks]; 
     951 
    945952        return _audioTracks; 
    946953} 
     
    982989 
    983990- (NSArray *)subtitleTracks { 
     991        if(_hasUnloadedTracks) 
     992                [self _loadTracks]; 
     993 
    984994        return _subtitleTracks; 
    985995}