Changeset 1185

Show
Ignore:
Timestamp:
10/25/09 02:30:03 (9 months ago)
Author:
astrange
Message:

Move the list of apps needing transparent blend mode to a defaults setting.
Also rename some things for consistency.

Location:
trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/CommonUtils.c

    r1173 r1185  
    300300} 
    301301 
    302 static const CFStringRef defaultFrameDroppingWhiteList[] = { 
     302static const CFStringRef defaultFrameDroppingList[] = { 
    303303        CFSTR("Finder"), 
    304304        CFSTR("Front Row"), 
     
    308308        CFSTR("QuickTime Player"), 
    309309        CFSTR("Spiral") 
     310}; 
     311 
     312static const CFStringRef defaultTransparentSubtitleList[] = { 
     313        CFSTR("CoreMediaAuthoringSourcePropertyHelper"), 
     314        CFSTR("Front Row") 
    310315}; 
    311316 
     
    384389        if (enabled == -1) 
    385390                enabled = isApplicationNameInList(CFSTR("FrameDroppingWhiteList"), 
    386                                                                                   defaultFrameDroppingWhiteList, 
    387                                                                                   sizeof(defaultFrameDroppingWhiteList)/sizeof(defaultFrameDroppingWhiteList[0])); 
     391                                                                                  defaultFrameDroppingList, 
     392                                                                                  sizeof(defaultFrameDroppingList)/sizeof(defaultFrameDroppingList[0])); 
    388393        return enabled; 
    389394} 
    390395 
    391 int forcePerianToDecode() 
     396int IsForcedDecodeEnabled() 
    392397{ 
    393398        static int forced = -1; 
     
    400405} 
    401406 
     407int IsTransparentSubtitleHackEnabled() 
     408{ 
     409        static int forced = -1; 
     410         
     411        if(forced == -1) 
     412                forced = isApplicationNameInList(CFSTR("TransparentModeSubtitleAppList"), 
     413                                                                                 defaultTransparentSubtitleList, 
     414                                                                                 sizeof(defaultTransparentSubtitleList)/sizeof(defaultTransparentSubtitleList[0])); 
     415        return forced; 
     416} 
     417 
    402418int IsAltivecSupported() 
    403419{ 
  • trunk/CommonUtils.h

    r1173 r1185  
    5555 
    5656// does the current process break if we return errors in Preflight? 
    57 int forcePerianToDecode(); 
     57int IsForcedDecodeEnabled(); 
     58 
     59// does the current process break if we use graphicsModePreBlackAlpha? 
     60int IsTransparentSubtitleHackEnabled(); 
    5861 
    5962int IsAltivecSupported(); 
  • trunk/FFusionCodec.c

    r1175 r1185  
    571571                decode = FFUSION_PREFER_NOT_DECODE; 
    572572        if(decode > FFUSION_CANNOT_DECODE) 
    573                 if(forcePerianToDecode()) 
     573                if(IsForcedDecodeEnabled()) 
    574574                        decode = FFUSION_PREFER_DECODE; 
    575575        return decode > FFUSION_PREFER_NOT_DECODE; 
  • trunk/Subtitles/SubATSUIRenderer.m

    r1163 r1185  
    12881288        CGColorSpaceRelease(csp); 
    12891289        */ 
    1290          
    12911290        SubDisposeRenderer(s); 
    12921291} 
  • trunk/Subtitles/SubImport.mm

    r1177 r1185  
    8585static bool ShouldEngageFrontRowHack(void) 
    8686{ 
    87         bool ret; 
    88         Boolean isSet; 
    89          
    90         NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
    91         NSString *applicationName = [[NSProcessInfo processInfo] processName]; 
    9287        long minorVersion; 
    9388        Gestalt(gestaltSystemVersionMinor, &minorVersion); 
    94         if (!CFPreferencesGetAppBooleanValue(CFSTR("PerianFrontRowSubtitleHack"),CFSTR("org.perian.Perian"),&isSet)) 
    95                 isSet = 1; 
    96          
    97         bool systemVersionCheck = (minorVersion >= 5) && (minorVersion <= 6); 
    98         bool appNameCheck = ([applicationName isEqualToString:@"Front Row"] || [applicationName isEqualToString:@"CoreMediaAuthoringSourcePropertyHelper"]); 
    99         ret = systemVersionCheck && appNameCheck && isSet; 
    100         [pool release]; 
    101          
    102         return ret; 
     89         
     90        bool systemVersionCheck = minorVersion >= 5; 
     91        bool appNameCheck = IsTransparentSubtitleHackEnabled(); 
     92         
     93        return systemVersionCheck && appNameCheck; 
    10394} 
    10495