Changeset 1fd7a5108a139eaf0789128034cd8cde662dfc25
- 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
| r19219d5 |
r1fd7a51 |
|
| 91 | 91 | 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 -' |
|---|
| 92 | 92 | |
|---|
| 93 | | def getHDtivos(): # tsn's of High Definition Tivo's |
|---|
| 94 | | return ['648', '652'] |
|---|
| | 93 | def getHDtivos(tsn): # tsn's of High Definition Tivo's |
|---|
| | 94 | if tsn and tsn[:3] in ['648', '652']: |
|---|
| | 95 | return True |
|---|
| | 96 | return False |
|---|
| 95 | 97 | |
|---|
| 96 | 98 | def getValidWidths(): |
|---|
| … | … | |
| 128 | 130 | return nearestTivoHeight(height) |
|---|
| 129 | 131 | except NoOptionError: #defaults for S3/S2 TiVo |
|---|
| 130 | | if tsn and tsn[:3] in getHDtivos(): |
|---|
| | 132 | if getHDtivos(tsn): |
|---|
| 131 | 133 | return 720 |
|---|
| 132 | 134 | else: |
|---|
| … | … | |
| 144 | 146 | return nearestTivoWidth(width) |
|---|
| 145 | 147 | except NoOptionError: #defaults for S3/S2 TiVo |
|---|
| 146 | | if tsn and tsn[:3] in getHDtivos(): |
|---|
| | 148 | if getHDtivos(tsn): |
|---|
| 147 | 149 | return 1280 |
|---|
| 148 | 150 | else: |
|---|
| … | … | |
| 162 | 164 | return str(min(audiobr, getMaxAudioBR(tsn))) + 'k' |
|---|
| 163 | 165 | except NoOptionError: #defaults for S3/S2 TiVo |
|---|
| 164 | | if tsn and tsn[:3] in getHDtivos(): |
|---|
| | 166 | if getHDtivos(tsn): |
|---|
| 165 | 167 | return '384k' |
|---|
| 166 | 168 | else: |
|---|
| … | … | |
| 176 | 178 | return config.get('Server', 'video_br') |
|---|
| 177 | 179 | except NoOptionError: #defaults for S3/S2 TiVo |
|---|
| 178 | | if tsn and tsn[:3] in getHDtivos(): |
|---|
| | 180 | if getHDtivos(tsn): |
|---|
| 179 | 181 | return '8192k' |
|---|
| 180 | 182 | else: |
|---|
| … | … | |
| 203 | 205 | return int(int(strtod(config.get('Server', 'max_audio_br'))/1000)/64)*64 |
|---|
| 204 | 206 | except NoOptionError: |
|---|
| 205 | | if tsn and tsn[:3] in getHDtivos(): |
|---|
| | 207 | if getHDtivos(tsn): |
|---|
| 206 | 208 | return int(448) #default to 448, max supported by HD TiVo's |
|---|
| 207 | 209 | else: |
|---|
| r6fc56fd |
r1fd7a51 |
|
| 66 | 66 | def select_audiocodec(tsn = ''): |
|---|
| 67 | 67 | #check for HD tivo and return compatible audio parameters |
|---|
| 68 | | if tsn and tsn[:3] in config.getHDtivos(): |
|---|
| | 68 | if config.getHDtivos(tsn): |
|---|
| 69 | 69 | return '-acodec ac3 -ar 48000' |
|---|
| 70 | 70 | else: |
|---|
| … | … | |
| 104 | 104 | multiplier4by3 = (4.0 * TIVO_HEIGHT) / (3.0 * TIVO_WIDTH) |
|---|
| 105 | 105 | |
|---|
| 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: |
|---|
| 107 | 107 | return [] #pass all resolutions to S3/HD, except heights greater than conf height |
|---|
| 108 | 108 | # else, optres is enabled and resizes SD video to the "S2" standard on S3/HD. |
|---|
| … | … | |
| 244 | 244 | return False |
|---|
| 245 | 245 | |
|---|
| 246 | | if tsn[:3] in config.getHDtivos(): |
|---|
| | 246 | if config.getHDtivos(tsn): |
|---|
| 247 | 247 | debug_write(['tivo_compatible: ', inFile, ' you have a S3 skiping the rest of the tests', '\n']) |
|---|
| 248 | 248 | return True |
|---|