Changeset 1fd7a5108a139eaf0789128034cd8cde662dfc25

Show
Ignore:
Timestamp:
02/03/08 03:28:49 (10 months ago)
Author:
wgw <tjm1100@gmail.com>
git-committer:
wgw <tjm1100@gmail.com> 1202030929 -0600
git-parent:

[19219d5ab59e4ad7c29ff6feef707311a3bb3ba9]

git-author:
wgw <tjm1100@gmail.com> 1202030929 -0600
Message:

getHDtivos simplify

no change in functionality

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • config.py

    r19219d5 r1fd7a51  
    9191        return '-vcodec mpeg2video -r 29.97 -b %(video_br)s -maxrate %(max_video_br)s -bufsize %(buff_size)s %(aspect_ratio)s -comment pyTivo.py %(audio_codec)s -ab %(audio_br)s -f vob -' 
    9292 
    93 def getHDtivos():  # tsn's of High Definition Tivo's 
    94     return ['648', '652'] 
     93def getHDtivos(tsn):  # tsn's of High Definition Tivo's 
     94    if tsn and tsn[:3] in ['648', '652']: 
     95        return True 
     96    return False 
    9597 
    9698def getValidWidths(): 
     
    128130        return nearestTivoHeight(height) 
    129131    except NoOptionError: #defaults for S3/S2 TiVo 
    130         if tsn and tsn[:3] in getHDtivos(): 
     132        if getHDtivos(tsn): 
    131133            return 720 
    132134        else: 
     
    144146        return nearestTivoWidth(width) 
    145147    except NoOptionError: #defaults for S3/S2 TiVo 
    146         if tsn and tsn[:3] in getHDtivos(): 
     148        if getHDtivos(tsn): 
    147149            return 1280 
    148150        else: 
     
    162164        return str(min(audiobr, getMaxAudioBR(tsn))) + 'k' 
    163165    except NoOptionError: #defaults for S3/S2 TiVo 
    164         if tsn and tsn[:3] in getHDtivos(): 
     166        if getHDtivos(tsn): 
    165167            return '384k' 
    166168        else: 
     
    176178        return config.get('Server', 'video_br') 
    177179    except NoOptionError: #defaults for S3/S2 TiVo 
    178         if tsn and tsn[:3] in getHDtivos(): 
     180        if getHDtivos(tsn): 
    179181            return '8192k' 
    180182        else: 
     
    203205        return int(int(strtod(config.get('Server', 'max_audio_br'))/1000)/64)*64 
    204206    except NoOptionError:  
    205         if tsn and tsn[:3] in getHDtivos(): 
     207        if getHDtivos(tsn): 
    206208            return int(448) #default to 448, max supported by HD TiVo's 
    207209        else: 
  • plugins/video/transcode.py

    r6fc56fd r1fd7a51  
    6666def select_audiocodec(tsn = ''): 
    6767    #check for HD tivo and return compatible audio parameters 
    68     if tsn and tsn[:3] in config.getHDtivos(): 
     68    if config.getHDtivos(tsn): 
    6969        return '-acodec ac3 -ar 48000' 
    7070    else: 
     
    104104    multiplier4by3  =  (4.0 * TIVO_HEIGHT) / (3.0 * TIVO_WIDTH) 
    105105    
    106     if tsn[:3] in config.getHDtivos() and height <= TIVO_HEIGHT and config.getOptres() == False: 
     106    if config.getHDtivos(tsn) and height <= TIVO_HEIGHT and config.getOptres() == False: 
    107107        return [] #pass all resolutions to S3/HD, except heights greater than conf height 
    108108                # else, optres is enabled and resizes SD video to the "S2" standard on S3/HD. 
     
    244244        return False 
    245245 
    246     if tsn[:3] in config.getHDtivos(): 
     246    if config.getHDtivos(tsn): 
    247247        debug_write(['tivo_compatible: ', inFile, ' you have a S3 skiping the rest of the tests', '\n']) 
    248248        return True