Changeset 46112 for trunk/src/wp-includes/ID3/module.audio.dts.php
- Timestamp:
- 09/14/2019 07:06:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/module.audio.dts.php
r32979 r46112 1 1 <?php 2 2 3 ///////////////////////////////////////////////////////////////// 3 4 /// getID3() by James Heinrich <info@getid3.org> // 4 // available at http://getid3.sourceforge.net // 5 // or http://www.getid3.org // 6 // also https://github.com/JamesHeinrich/getID3 // 7 ///////////////////////////////////////////////////////////////// 8 // See readme.txt for more details // 5 // available at https://github.com/JamesHeinrich/getID3 // 6 // or https://www.getid3.org // 7 // or http://getid3.sourceforge.net // 8 // see readme.txt for more details // 9 9 ///////////////////////////////////////////////////////////////// 10 10 // // … … 22 22 { 23 23 /** 24 * Default DTS syncword used in native .cpt or .dts formats 25 */ 26 const syncword = "\x7F\xFE\x80\x01"; 27 24 * Default DTS syncword used in native .cpt or .dts formats. 25 */ 26 const syncword = "\x7F\xFE\x80\x01"; 27 28 /** 29 * @var int 30 */ 28 31 private $readBinDataOffset = 0; 29 32 30 /** 31 * Possible syncwords indicating bitstream encoding 32 */ 33 public static $syncwords = array( 34 0 => "\x7F\xFE\x80\x01", // raw big-endian 35 1 => "\xFE\x7F\x01\x80", // raw little-endian 36 2 => "\x1F\xFF\xE8\x00", // 14-bit big-endian 37 3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian 38 33 /** 34 * Possible syncwords indicating bitstream encoding. 35 */ 36 public static $syncwords = array( 37 0 => "\x7F\xFE\x80\x01", // raw big-endian 38 1 => "\xFE\x7F\x01\x80", // raw little-endian 39 2 => "\x1F\xFF\xE8\x00", // 14-bit big-endian 40 3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian 41 42 /** 43 * @return bool 44 */ 39 45 public function Analyze() { 40 46 $info = &$this->getid3->info; … … 46 52 // check syncword 47 53 $sync = substr($DTSheader, 0, 4); 48 49 50 54 if (($encoding = array_search($sync, self::$syncwords)) !== false) { 55 56 $info['dts']['raw']['magic'] = $sync; 51 57 $this->readBinDataOffset = 32; 52 58 53 59 } elseif ($this->isDependencyFor('matroska')) { 54 60 55 61 // Matroska contains DTS without syncword encoded as raw big-endian format … … 57 63 $this->readBinDataOffset = 0; 58 64 59 65 } else { 60 66 61 67 unset($info['fileformat']); … … 140 146 } 141 147 148 /** 149 * @param string $bin 150 * @param int $length 151 * 152 * @return float|int 153 */ 142 154 private function readBinData($bin, $length) { 143 155 $data = substr($bin, $this->readBinDataOffset, $length); … … 147 159 } 148 160 161 /** 162 * @param int $index 163 * 164 * @return int|string|false 165 */ 149 166 public static function bitrateLookup($index) { 150 167 static $lookup = array( … … 185 202 } 186 203 204 /** 205 * @param int $index 206 * 207 * @return int|string|false 208 */ 187 209 public static function sampleRateLookup($index) { 188 210 static $lookup = array( … … 207 229 } 208 230 231 /** 232 * @param int $index 233 * 234 * @return int|false 235 */ 209 236 public static function bitPerSampleLookup($index) { 210 237 static $lookup = array( … … 217 244 } 218 245 246 /** 247 * @param int $index 248 * 249 * @return int|false 250 */ 219 251 public static function numChannelsLookup($index) { 220 252 switch ($index) { … … 255 287 } 256 288 289 /** 290 * @param int $index 291 * 292 * @return string 293 */ 257 294 public static function channelArrangementLookup($index) { 258 295 static $lookup = array( … … 277 314 } 278 315 316 /** 317 * @param int $index 318 * @param int $version 319 * 320 * @return int|false 321 */ 279 322 public static function dialogNormalization($index, $version) { 280 323 switch ($version) {
Note: See TracChangeset
for help on using the changeset viewer.