Changeset 47601
- Timestamp:
- 04/20/2020 11:11:48 AM (4 years ago)
- Location:
- trunk/src/wp-includes/ID3
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/getid3.lib.php
r46586 r47601 16 16 { 17 17 /** 18 * @param string $string19 * @param bool $hex20 * @param bool $spaces21 * @param string $htmlencoding18 * @param string $string 19 * @param bool $hex 20 * @param bool $spaces 21 * @param string|bool $htmlencoding 22 22 * 23 23 * @return string … … 217 217 default: 218 218 return false; 219 break;220 219 } 221 220 if ($floatvalue >= 0) { … … 285 284 } 286 285 return $floatvalue; 287 break;288 286 289 287 default: 290 288 return false; 291 break;292 289 } 293 290 $exponentstring = substr($bitword, 1, $exponentbits); … … 501 498 502 499 /** 503 * @param array$array1504 * @param array$array2500 * @param mixed $array1 501 * @param mixed $array2 505 502 * 506 503 * @return array|false … … 524 521 525 522 /** 526 * @param array$array1527 * @param array$array2523 * @param mixed $array1 524 * @param mixed $array2 528 525 * 529 526 * @return array|false … … 545 542 546 543 /** 547 * @param array$array1548 * @param array$array2544 * @param mixed $array1 545 * @param mixed $array2 549 546 * 550 547 * @return array|false|null … … 736 733 737 734 /** 738 * @param SimpleXMLElement|array $XMLobject735 * @param SimpleXMLElement|array|mixed $XMLobject 739 736 * 740 * @return array737 * @return mixed 741 738 */ 742 739 public static function SimpleXMLelement2array($XMLobject) { … … 1480 1477 */ 1481 1478 public static function GetDataImageSize($imgData, &$imageinfo=array()) { 1479 if (PHP_VERSION_ID >= 50400) { 1480 $GetDataImageSize = @getimagesizefromstring($imgData, $imageinfo); 1481 if ($GetDataImageSize === false || !isset($GetDataImageSize[0], $GetDataImageSize[1])) { 1482 return false; 1483 } 1484 $GetDataImageSize['height'] = $GetDataImageSize[0]; 1485 $GetDataImageSize['width'] = $GetDataImageSize[1]; 1486 return $GetDataImageSize; 1487 } 1482 1488 static $tempdir = ''; 1483 1489 if (empty($tempdir)) { … … 1488 1494 // yes this is ugly, feel free to suggest a better way 1489 1495 if (include_once(dirname(__FILE__).'/getid3.php')) { 1490 if ($getid3_temp = new getID3()) { 1491 if ($getid3_temp_tempdir = $getid3_temp->tempdir) { 1492 $tempdir = $getid3_temp_tempdir; 1493 } 1494 unset($getid3_temp, $getid3_temp_tempdir); 1495 } 1496 $getid3_temp = new getID3(); 1497 if ($getid3_temp_tempdir = $getid3_temp->tempdir) { 1498 $tempdir = $getid3_temp_tempdir; 1499 } 1500 unset($getid3_temp, $getid3_temp_tempdir); 1496 1501 } 1497 1502 } … … 1569 1574 $ThisFileInfo['comments'][$tagname][$key] = $value; 1570 1575 } else { 1571 if ( isset($ThisFileInfo['comments'][$tagname])) {1576 if (!isset($ThisFileInfo['comments'][$tagname])) { 1572 1577 $ThisFileInfo['comments'][$tagname] = array($value); 1573 1578 } else { -
trunk/src/wp-includes/ID3/getid3.php
r46586 r47601 251 251 protected $startup_warning = ''; 252 252 253 const VERSION = '1.9.1 8-201907240906';253 const VERSION = '1.9.19-201912131005'; 254 254 const FREAD_BUFFER_SIZE = 32768; 255 255 … … 267 267 268 268 // Check memory 269 $ this->memory_limit = ini_get('memory_limit');270 if (preg_match('#([0-9]+) ?M#i', $ this->memory_limit, $matches)) {269 $memoryLimit = ini_get('memory_limit'); 270 if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) { 271 271 // could be stored as "16M" rather than 16777216 for example 272 $ this->memory_limit = $matches[1] * 1048576;273 } elseif (preg_match('#([0-9]+) ?G#i', $ this->memory_limit, $matches)) { // The 'G' modifier is available since PHP 5.1.0272 $memoryLimit = $matches[1] * 1048576; 273 } elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0 274 274 // could be stored as "2G" rather than 2147483648 for example 275 $this->memory_limit = $matches[1] * 1073741824; 276 } 275 $memoryLimit = $matches[1] * 1073741824; 276 } 277 $this->memory_limit = $memoryLimit; 278 277 279 if ($this->memory_limit <= 0) { 278 280 // memory limits probably disabled … … 288 290 } 289 291 290 if (($mbstring_func_overload = ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {292 if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) { 291 293 // http://php.net/manual/en/mbstring.overload.php 292 294 // "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions" … … 295 297 } 296 298 297 // WORDPRESS CHANGE FROM UPSTREAM 298 // Comment out deprecated function 299 /* 300 // Check for magic_quotes_runtime 301 if (function_exists('get_magic_quotes_runtime')) { 302 if (get_magic_quotes_runtime()) { 303 $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n"; 304 } 305 } 306 307 // Check for magic_quotes_gpc 308 if (function_exists('magic_quotes_gpc')) { 309 if (get_magic_quotes_gpc()) { 310 $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n"; 311 } 312 } 313 **/ 299 // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated) 300 if (version_compare(PHP_VERSION, '7.4.0', '<')) { 301 // Check for magic_quotes_runtime 302 if (function_exists('get_magic_quotes_runtime')) { 303 if (get_magic_quotes_runtime()) { 304 $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n"; 305 } 306 } 307 // Check for magic_quotes_gpc 308 if (function_exists('get_magic_quotes_gpc')) { 309 if (get_magic_quotes_gpc()) { 310 $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n"; 311 } 312 } 313 } 314 314 315 315 // Load support library … … 403 403 404 404 /** 405 * @param string $filename 406 * @param int $filesize 405 * @param string $filename 406 * @param int $filesize 407 * @param resource $fp 407 408 * 408 409 * @return bool … … 514 515 * analyze file 515 516 * 516 * @param string $filename 517 * @param int $filesize 518 * @param string $original_filename 517 * @param string $filename 518 * @param int $filesize 519 * @param string $original_filename 520 * @param resource $fp 519 521 * 520 522 * @return array … … 1105 1107 'module' => 'ts', 1106 1108 'mime_type' => 'video/MP2T', 1109 ), 1110 1111 // WTV - audio/video - Windows Recorded TV Show 1112 'wtv' => array( 1113 'pattern' => '^\\xB7\\xD8\\x00\\x20\\x37\\x49\\xDA\\x11\\xA6\\x4E\\x00\\x07\\xE9\\x5E\\xAD\\x8D', 1114 'group' => 'audio-video', 1115 'module' => 'wtv', 1116 'mime_type' => 'video/x-ms-wtv', 1107 1117 ), 1108 1118 … … 1529 1539 default: 1530 1540 return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()'); 1531 break;1532 1541 } 1533 1542 -
trunk/src/wp-includes/ID3/module.audio-video.asf.php
r46586 r47601 364 364 365 365 if (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) { 366 $thisfile_audio['bitrate'] = (int) (trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000);366 $thisfile_audio['bitrate'] = (int) trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000; 367 367 } 368 368 //if (!isset($thisfile_video['bitrate']) && isset($thisfile_audio['bitrate']) && isset($thisfile_asf['file_properties_object']['max_bitrate']) && ($thisfile_asf_codeclistobject['codec_entries_count'] > 1)) { … … 808 808 case 'wm/track': 809 809 if (empty($thisfile_asf_comments['track_number'])) { 810 $thisfile_asf_comments['track_number'] = array(1 + $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));810 $thisfile_asf_comments['track_number'] = array(1 + (int) $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); 811 811 } 812 812 break; -
trunk/src/wp-includes/ID3/module.audio-video.flv.php
r46586 r47601 598 598 case 6: 599 599 return null; 600 break;601 600 602 601 // Mixed array -
trunk/src/wp-includes/ID3/module.audio-video.quicktime.php
r46586 r47601 113 113 // https://en.wikipedia.org/wiki/ISO_6709 114 114 foreach ($info['quicktime']['comments']['location.ISO6709'] as $ISO6709string) { 115 $latitude = false; 116 $longitude = false; 117 $altitude = false; 115 $ISO6709parsed = array('latitude'=>false, 'longitude'=>false, 'altitude'=>false); 118 116 if (preg_match('#^([\\+\\-])([0-9]{2}|[0-9]{4}|[0-9]{6})(\\.[0-9]+)?([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?(([\\+\\-])([0-9]{3}|[0-9]{5}|[0-9]{7})(\\.[0-9]+)?)?/$#', $ISO6709string, $matches)) { 119 117 @list($dummy, $lat_sign, $lat_deg, $lat_deg_dec, $lon_sign, $lon_deg, $lon_deg_dec, $dummy, $alt_sign, $alt_deg, $alt_deg_dec) = $matches; 120 118 121 119 if (strlen($lat_deg) == 2) { // [+-]DD.D 122 $ latitude =floatval(ltrim($lat_deg, '0').$lat_deg_dec);120 $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim($lat_deg, '0').$lat_deg_dec); 123 121 } elseif (strlen($lat_deg) == 4) { // [+-]DDMM.M 124 $ latitude =floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0').$lat_deg_dec / 60);122 $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0').$lat_deg_dec / 60); 125 123 } elseif (strlen($lat_deg) == 6) { // [+-]DDMMSS.S 126 $ latitude =floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lat_deg, 4, 2), '0').$lat_deg_dec / 3600);124 $ISO6709parsed['latitude'] = (($lat_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lat_deg, 0, 2), '0')) + floatval(ltrim(substr($lat_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lat_deg, 4, 2), '0').$lat_deg_dec / 3600); 127 125 } 128 126 129 127 if (strlen($lon_deg) == 3) { // [+-]DDD.D 130 $ longitude =floatval(ltrim($lon_deg, '0').$lon_deg_dec);128 $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim($lon_deg, '0').$lon_deg_dec); 131 129 } elseif (strlen($lon_deg) == 5) { // [+-]DDDMM.M 132 $ longitude =floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0').$lon_deg_dec / 60);130 $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0').$lon_deg_dec / 60); 133 131 } elseif (strlen($lon_deg) == 7) { // [+-]DDDMMSS.S 134 $ longitude =floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lon_deg, 4, 2), '0').$lon_deg_dec / 3600);132 $ISO6709parsed['longitude'] = (($lon_sign == '-') ? -1 : 1) * floatval(ltrim(substr($lon_deg, 0, 2), '0')) + floatval(ltrim(substr($lon_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($lon_deg, 4, 2), '0').$lon_deg_dec / 3600); 135 133 } 136 134 137 135 if (strlen($alt_deg) == 3) { // [+-]DDD.D 138 $ altitude =floatval(ltrim($alt_deg, '0').$alt_deg_dec);136 $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim($alt_deg, '0').$alt_deg_dec); 139 137 } elseif (strlen($alt_deg) == 5) { // [+-]DDDMM.M 140 $ altitude =floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0').$alt_deg_dec / 60);138 $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0').$alt_deg_dec / 60); 141 139 } elseif (strlen($alt_deg) == 7) { // [+-]DDDMMSS.S 142 $altitude = floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($alt_deg, 4, 2), '0').$alt_deg_dec / 3600); 143 } 144 145 if ($latitude !== false) { 146 $info['quicktime']['comments']['gps_latitude'][] = (($lat_sign == '-') ? -1 : 1) * floatval($latitude); 147 } 148 if ($longitude !== false) { 149 $info['quicktime']['comments']['gps_longitude'][] = (($lon_sign == '-') ? -1 : 1) * floatval($longitude); 150 } 151 if ($altitude !== false) { 152 $info['quicktime']['comments']['gps_altitude'][] = (($alt_sign == '-') ? -1 : 1) * floatval($altitude); 140 $ISO6709parsed['altitude'] = (($alt_sign == '-') ? -1 : 1) * floatval(ltrim(substr($alt_deg, 0, 2), '0')) + floatval(ltrim(substr($alt_deg, 2, 2), '0') / 60) + floatval(ltrim(substr($alt_deg, 4, 2), '0').$alt_deg_dec / 3600); 141 } 142 143 foreach (array('latitude', 'longitude', 'altitude') as $key) { 144 if ($ISO6709parsed[$key] !== false) { 145 $value = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]); 146 if (!in_array($value, $info['quicktime']['comments']['gps_'.$key])) { 147 $info['quicktime']['comments']['gps_'.$key][] = (($lat_sign == '-') ? -1 : 1) * floatval($ISO6709parsed[$key]); 148 } 149 } 153 150 } 154 151 } 155 if ($ latitude=== false) {152 if ($ISO6709parsed['latitude'] === false) { 156 153 $this->warning('location.ISO6709 string not parsed correctly: "'.$ISO6709string.'", please submit as a bug'); 157 154 } … … 225 222 $atom_parent = end($atomHierarchy); // not array_pop($atomHierarchy); see https://www.getid3.org/phpBB3/viewtopic.php?t=1717 226 223 array_push($atomHierarchy, $atomname); 224 $atom_structure = array(); 227 225 $atom_structure['hierarchy'] = implode(' ', $atomHierarchy); 228 226 $atom_structure['name'] = $atomname; … … 245 243 case 'minf': // Media INFormation container atom 246 244 case 'dinf': // Data INFormation container atom 245 case 'nmhd': // Null Media HeaDer container atom 247 246 case 'udta': // User DaTA container atom 248 247 case 'cmov': // Compressed MOVie container atom … … 1045 1044 1046 1045 case 'stco': // Sample Table Chunk Offset atom 1046 // if (true) { 1047 1047 if ($ParseAllPossibleAtoms) { 1048 1048 $atom_structure['version'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 1)); … … 1640 1640 break; 1641 1641 1642 case 'uuid': // Atom holding 360fly spatial data?? 1643 /* code in this block by Paul Lewis 2019-Oct-31 */ 1644 /* Sensor Timestamps need to be calculated using the recordings base time at ['quicktime']['moov']['subatoms'][0]['creation_time_unix']. */ 1645 $atom_structure['title'] = '360Fly Sensor Data'; 1646 1647 //Get the UUID ID in first 16 bytes 1648 $uuid_bytes_read = unpack('H8time_low/H4time_mid/H4time_hi/H4clock_seq_hi/H12clock_seq_low', substr($atom_data, 0, 16)); 1649 $atom_structure['uuid_field_id'] = print_r(implode('-', $uuid_bytes_read), true); 1650 1651 //Get the UUID HEADER data 1652 $uuid_bytes_read = unpack('Sheader_size/Sheader_version/Stimescale/Shardware_version/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/x/', substr($atom_data, 16, 32)); 1653 $atom_structure['uuid_header'] = json_encode($uuid_bytes_read, true); 1654 1655 $start_byte = 48; 1656 $atom_SENSOR_data = substr($atom_data, $start_byte); 1657 $atom_structure['sensor_data']['data_type'] = array( 1658 'fusion_count' => 0, // ID 250 1659 'fusion_data' => array(), 1660 'accel_count' => 0, // ID 1 1661 'accel_data' => array(), 1662 'gyro_count' => 0, // ID 2 1663 'gyro_data' => array(), 1664 'magno_count' => 0, // ID 3 1665 'magno_data' => array(), 1666 'gps_count' => 0, // ID 5 1667 'gps_data' => array(), 1668 'rotation_count' => 0, // ID 6 1669 'rotation_data' => array(), 1670 'unknown_count' => 0, // ID ?? 1671 'unknown_data' => array(), 1672 'debug_list' => '', // Used to debug variables stored as comma delimited strings 1673 ); 1674 $debug_structure['debug_items'] = array(); 1675 // Can start loop here to decode all sensor data in 32 Byte chunks: 1676 foreach (str_split($atom_SENSOR_data, 32) as $sensor_key => $sensor_data) { 1677 // This gets me a data_type code to work out what data is in the next 31 bytes. 1678 $sensor_data_type = substr($sensor_data, 0, 1); 1679 $sensor_data_content = substr($sensor_data, 1); 1680 $uuid_bytes_read = unpack('C*', $sensor_data_type); 1681 $sensor_data_array = array(); 1682 switch ($uuid_bytes_read[1]) { 1683 case 250: 1684 $atom_structure['sensor_data']['data_type']['fusion_count']++; 1685 $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content); 1686 $sensor_data_array['mode'] = $uuid_bytes_read['mode']; 1687 $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp']; 1688 $sensor_data_array['yaw'] = $uuid_bytes_read['yaw']; 1689 $sensor_data_array['pitch'] = $uuid_bytes_read['pitch']; 1690 $sensor_data_array['roll'] = $uuid_bytes_read['roll']; 1691 array_push($atom_structure['sensor_data']['data_type']['fusion_data'], $sensor_data_array); 1692 break; 1693 case 1: 1694 $atom_structure['sensor_data']['data_type']['accel_count']++; 1695 $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content); 1696 $sensor_data_array['mode'] = $uuid_bytes_read['mode']; 1697 $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp']; 1698 $sensor_data_array['yaw'] = $uuid_bytes_read['yaw']; 1699 $sensor_data_array['pitch'] = $uuid_bytes_read['pitch']; 1700 $sensor_data_array['roll'] = $uuid_bytes_read['roll']; 1701 array_push($atom_structure['sensor_data']['data_type']['accel_data'], $sensor_data_array); 1702 break; 1703 case 2: 1704 $atom_structure['sensor_data']['data_type']['gyro_count']++; 1705 $uuid_bytes_read = unpack('cmode/Jtimestamp/Gyaw/Gpitch/Groll/x*', $sensor_data_content); 1706 $sensor_data_array['mode'] = $uuid_bytes_read['mode']; 1707 $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp']; 1708 $sensor_data_array['yaw'] = $uuid_bytes_read['yaw']; 1709 $sensor_data_array['pitch'] = $uuid_bytes_read['pitch']; 1710 $sensor_data_array['roll'] = $uuid_bytes_read['roll']; 1711 array_push($atom_structure['sensor_data']['data_type']['gyro_data'], $sensor_data_array); 1712 break; 1713 case 3: 1714 $atom_structure['sensor_data']['data_type']['magno_count']++; 1715 $uuid_bytes_read = unpack('cmode/Jtimestamp/Gmagx/Gmagy/Gmagz/x*', $sensor_data_content); 1716 $sensor_data_array['mode'] = $uuid_bytes_read['mode']; 1717 $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp']; 1718 $sensor_data_array['magx'] = $uuid_bytes_read['magx']; 1719 $sensor_data_array['magy'] = $uuid_bytes_read['magy']; 1720 $sensor_data_array['magz'] = $uuid_bytes_read['magz']; 1721 array_push($atom_structure['sensor_data']['data_type']['magno_data'], $sensor_data_array); 1722 break; 1723 case 5: 1724 $atom_structure['sensor_data']['data_type']['gps_count']++; 1725 $uuid_bytes_read = unpack('cmode/Jtimestamp/Glat/Glon/Galt/Gspeed/nbearing/nacc/x*', $sensor_data_content); 1726 $sensor_data_array['mode'] = $uuid_bytes_read['mode']; 1727 $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp']; 1728 $sensor_data_array['lat'] = $uuid_bytes_read['lat']; 1729 $sensor_data_array['lon'] = $uuid_bytes_read['lon']; 1730 $sensor_data_array['alt'] = $uuid_bytes_read['alt']; 1731 $sensor_data_array['speed'] = $uuid_bytes_read['speed']; 1732 $sensor_data_array['bearing'] = $uuid_bytes_read['bearing']; 1733 $sensor_data_array['acc'] = $uuid_bytes_read['acc']; 1734 //$sensor_data_array = print_r($uuid_bytes_read, true); 1735 array_push($atom_structure['sensor_data']['data_type']['gps_data'], $sensor_data_array); 1736 //array_push($debug_structure['debug_items'], $uuid_bytes_read['timestamp']); 1737 break; 1738 case 6: 1739 $atom_structure['sensor_data']['data_type']['rotation_count']++; 1740 $uuid_bytes_read = unpack('cmode/Jtimestamp/Grotx/Groty/Grotz/x*', $sensor_data_content); 1741 $sensor_data_array['mode'] = $uuid_bytes_read['mode']; 1742 $sensor_data_array['timestamp'] = $uuid_bytes_read['timestamp']; 1743 $sensor_data_array['rotx'] = $uuid_bytes_read['rotx']; 1744 $sensor_data_array['roty'] = $uuid_bytes_read['roty']; 1745 $sensor_data_array['rotz'] = $uuid_bytes_read['rotz']; 1746 array_push($atom_structure['sensor_data']['data_type']['rotation_data'], $sensor_data_array); 1747 break; 1748 default: 1749 $atom_structure['sensor_data']['data_type']['unknown_count']++; 1750 break; 1751 } 1752 } 1753 // if (isset($debug_structure['debug_items']) && count($debug_structure['debug_items']) > 0) { 1754 // $atom_structure['sensor_data']['data_type']['debug_list'] = implode(',', $debug_structure['debug_items']); 1755 // } else { 1756 $atom_structure['sensor_data']['data_type']['debug_list'] = 'No debug items in list!'; 1757 // } 1758 break; 1759 1642 1760 case 'gps ': 1643 1761 // https://dashcamtalk.com/forum/threads/script-to-extract-gps-data-from-novatek-mp4.20808/page-2#post-291730 … … 1684 1802 if (preg_match('#\\$GPRMC,([0-9\\.]*),([AV]),([0-9\\.]*),([NS]),([0-9\\.]*),([EW]),([0-9\\.]*),([0-9\\.]*),([0-9]*),([0-9\\.]*),([EW]?)(,[A])?(\\*[0-9A-F]{2})#', $GPS_free_data, $matches)) { 1685 1803 $GPS_this_GPRMC = array(); 1804 $GPS_this_GPRMC_raw = array(); 1686 1805 list( 1687 $GPS_this_GPRMC ['raw']['gprmc'],1688 $GPS_this_GPRMC ['raw']['timestamp'],1689 $GPS_this_GPRMC ['raw']['status'],1690 $GPS_this_GPRMC ['raw']['latitude'],1691 $GPS_this_GPRMC ['raw']['latitude_direction'],1692 $GPS_this_GPRMC ['raw']['longitude'],1693 $GPS_this_GPRMC ['raw']['longitude_direction'],1694 $GPS_this_GPRMC ['raw']['knots'],1695 $GPS_this_GPRMC ['raw']['angle'],1696 $GPS_this_GPRMC ['raw']['datestamp'],1697 $GPS_this_GPRMC ['raw']['variation'],1698 $GPS_this_GPRMC ['raw']['variation_direction'],1806 $GPS_this_GPRMC_raw['gprmc'], 1807 $GPS_this_GPRMC_raw['timestamp'], 1808 $GPS_this_GPRMC_raw['status'], 1809 $GPS_this_GPRMC_raw['latitude'], 1810 $GPS_this_GPRMC_raw['latitude_direction'], 1811 $GPS_this_GPRMC_raw['longitude'], 1812 $GPS_this_GPRMC_raw['longitude_direction'], 1813 $GPS_this_GPRMC_raw['knots'], 1814 $GPS_this_GPRMC_raw['angle'], 1815 $GPS_this_GPRMC_raw['datestamp'], 1816 $GPS_this_GPRMC_raw['variation'], 1817 $GPS_this_GPRMC_raw['variation_direction'], 1699 1818 $dummy, 1700 $GPS_this_GPRMC ['raw']['checksum'],1819 $GPS_this_GPRMC_raw['checksum'], 1701 1820 ) = $matches; 1821 $GPS_this_GPRMC['raw'] = $GPS_this_GPRMC_raw; 1702 1822 1703 1823 $hour = substr($GPS_this_GPRMC['raw']['timestamp'], 0, 2); … … 1707 1827 $day = substr($GPS_this_GPRMC['raw']['datestamp'], 0, 2); 1708 1828 $month = substr($GPS_this_GPRMC['raw']['datestamp'], 2, 2); 1709 $year = substr($GPS_this_GPRMC['raw']['datestamp'], 4, 2);1829 $year = (int) substr($GPS_this_GPRMC['raw']['datestamp'], 4, 2); 1710 1830 $year += (($year > 90) ? 1900 : 2000); // complete lack of foresight: datestamps are stored with 2-digit years, take best guess 1711 1831 $GPS_this_GPRMC['timestamp'] = $year.'-'.$month.'-'.$day.' '.$hour.':'.$minute.':'.$second.$ms; … … 2741 2861 } 2742 2862 foreach ($gooddata as $data) { 2863 if (is_array($data) || (!empty($info['quicktime']['comments'][$comment_key]) && in_array($data, $info['quicktime']['comments'][$comment_key]))) { 2864 // avoid duplicate copies of identical data 2865 continue; 2866 } 2743 2867 $info['quicktime']['comments'][$comment_key][] = $data; 2744 2868 } -
trunk/src/wp-includes/ID3/module.audio-video.riff.php
r46586 r47601 204 204 $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex]; 205 205 206 $thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);206 $thisfile_audio = (array) getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]); 207 207 if (substr($thisfile_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') { 208 208 $this->warning('Audio codec = '.$thisfile_audio['codec']); -
trunk/src/wp-includes/ID3/module.audio.ac3.php
r46586 r47601 486 486 * @param int $length 487 487 * 488 * @return float|int488 * @return int 489 489 */ 490 490 private function readHeaderBSI($length) { -
trunk/src/wp-includes/ID3/module.audio.dts.php
r46586 r47601 150 150 * @param int $length 151 151 * 152 * @return float|int152 * @return int 153 153 */ 154 154 private function readBinData($bin, $length) { … … 253 253 case 0: 254 254 return 1; 255 break;256 255 case 1: 257 256 case 2: … … 259 258 case 4: 260 259 return 2; 261 break;262 260 case 5: 263 261 case 6: 264 262 return 3; 265 break;266 263 case 7: 267 264 case 8: 268 265 return 4; 269 break;270 266 case 9: 271 267 return 5; 272 break;273 268 case 10: 274 269 case 11: 275 270 case 12: 276 271 return 6; 277 break;278 272 case 13: 279 273 return 7; 280 break;281 274 case 14: 282 275 case 15: 283 276 return 8; 284 break;285 277 } 286 278 return false; … … 324 316 case 7: 325 317 return 0 - $index; 326 break;327 318 case 6: 328 319 return 0 - 16 - $index; 329 break;330 320 } 331 321 return false; -
trunk/src/wp-includes/ID3/module.audio.mp3.php
r46586 r47601 720 720 $thisfile_mpeg_audio_lame['long_version'] = substr($headerstring, $VBRidOffset + 120, 20); 721 721 $thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9); 722 723 if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') { 722 $thisfile_mpeg_audio_lame['numeric_version'] = str_replace('LAME', '', $thisfile_mpeg_audio_lame['short_version']); 723 if (preg_match('#^LAME([0-9\\.a-z]+)#', $thisfile_mpeg_audio_lame['long_version'], $matches)) { 724 $thisfile_mpeg_audio_lame['short_version'] = $matches[0]; 725 $thisfile_mpeg_audio_lame['numeric_version'] = $matches[1]; 726 } 727 foreach (explode('.', $thisfile_mpeg_audio_lame['numeric_version']) as $key => $number) { 728 $thisfile_mpeg_audio_lame['integer_version'][$key] = intval($number); 729 } 730 731 //if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') { 732 if ((($thisfile_mpeg_audio_lame['integer_version'][0] * 1000) + $thisfile_mpeg_audio_lame['integer_version'][1]) >= 3090) { // cannot use string version compare, may have "LAME3.90" or "LAME3.100" -- see https://github.com/JamesHeinrich/getID3/issues/207 724 733 725 734 // extra 11 chars are not part of version string when LAMEtag present … … 1325 1334 $this->fseek(-4, SEEK_CUR); 1326 1335 1327 getid3_lib::safe_inc($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]);1328 getid3_lib::safe_inc($Distribution['layer'][$LongMPEGlayerLookup[$head4]]);1329 getid3_lib::safe_inc($Distribution['version'][$LongMPEGversionLookup[$head4]]);1330 getid3_lib::safe_inc($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]);1331 getid3_lib::safe_inc($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]);1332 if ( $max_frames_scan && (++$frames_scanned >= $max_frames_scan)) {1336 $Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] = isset($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]) ? ++$Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] : 1; 1337 $Distribution['layer'][$LongMPEGlayerLookup[$head4]] = isset($Distribution['layer'][$LongMPEGlayerLookup[$head4]]) ? ++$Distribution['layer'][$LongMPEGlayerLookup[$head4]] : 1; 1338 $Distribution['version'][$LongMPEGversionLookup[$head4]] = isset($Distribution['version'][$LongMPEGversionLookup[$head4]]) ? ++$Distribution['version'][$LongMPEGversionLookup[$head4]] : 1; 1339 $Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] = isset($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]) ? ++$Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] : 1; 1340 $Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] = isset($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]) ? ++$Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] : 1; 1341 if (++$frames_scanned >= $max_frames_scan) { 1333 1342 $pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']); 1334 1343 $this->warning('too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); -
trunk/src/wp-includes/ID3/module.audio.ogg.php
r46586 r47601 616 616 default: 617 617 return false; 618 break;619 618 } 620 619 -
trunk/src/wp-includes/ID3/module.tag.id3v2.php
r46586 r47601 3724 3724 case 2: 3725 3725 return preg_match('#[A-Z][A-Z0-9]{2}#', $framename); 3726 break;3727 3726 3728 3727 case 3: 3729 3728 case 4: 3730 3729 return preg_match('#[A-Z][A-Z0-9]{3}#', $framename); 3731 break;3732 3730 } 3733 3731 return false; -
trunk/src/wp-includes/ID3/module.tag.lyrics3.php
r46586 r47601 33 33 $this->fseek((0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - "LYRICSEND" - [Lyrics3size] 34 34 $lyrics3_id3v1 = $this->fread(128 + 9 + 6); 35 $lyrics3lsz = substr($lyrics3_id3v1, 0,6); // Lyrics3size35 $lyrics3lsz = (int) substr($lyrics3_id3v1, 0, 6); // Lyrics3size 36 36 $lyrics3end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200 37 37 $id3v1tag = substr($lyrics3_id3v1, 15, 128); // ID3v1 … … 241 241 $this->error('Cannot process Lyrics3 version '.$version.' (only v1 and v2)'); 242 242 return false; 243 break;244 243 } 245 244
Note: See TracChangeset
for help on using the changeset viewer.