Changeset 4a19225407971ebbbd26840072d62ededc782d0e

Show
Ignore:
Timestamp:
02/16/08 01:33:48 (5 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1203122028 +0000
git-parent:

[c6f9a67d3f6741518abff10e1ea22f8dc984b7b1]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1203122028 +0000
Message:

macosx/framework: Only fetch meta when needed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/macosx/framework/Headers/Public/VLCMedia.h

    r762b3db r4a19225  
    114114    NSMutableDictionary * metaDictionary;    //< Meta data storage 
    115115    id                    delegate;          //< Delegate object 
    116     BOOL                  preparsed;         //< Value used to determine of the file has been preparsed 
     116    BOOL                  artFetched;        //< Value used to determine of the artwork has been preparsed 
    117117    VLCMediaState         state; 
    118118} 
  • projects/macosx/framework/Sources/VLCMedia.m

    r762b3db r4a19225  
    431431    libvlc_exception_init( &ex ); 
    432432 
     433    artFetched = NO; 
     434 
    433435    char * p_url = libvlc_media_descriptor_get_mrl( p_md, &ex ); 
    434436    catch_exception( &ex ); 
     
    464466     * And all the other meta will be added through the libvlc event system */ 
    465467    [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationTitle]; 
    466  
    467     /* Force VLCMetaInformationArtworkURL, that will trigger artwork fetching */ 
    468     [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL]; 
    469468} 
    470469 
     
    546545    [self setState: [newStateAsNumber intValue]]; 
    547546} 
     547 
     548- (id)valueForKeyPath:(NSString *)keyPath 
     549{ 
     550    if( ![metaDictionary objectForKey:@"artwork"] && [keyPath isEqualToString:@"metaDictionary.artwork"]) 
     551    { 
     552        artFetched = YES; 
     553        /* Force the retrieval of the artwork now that someone asked for it */ 
     554        [self fetchMetaInformationFromLibVLCWithType: VLCMetaInformationArtworkURL]; 
     555    } 
     556    return [super valueForKeyPath:keyPath]; 
     557} 
    548558@end 
    549559