Changeset 54376
- Timestamp:
- 10/04/2022 02:06:29 AM (3 years ago)
- Location:
- trunk/src/wp-includes/ID3
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/getid3.lib.php
r52254 r54376 12 12 ///////////////////////////////////////////////////////////////// 13 13 14 if(!defined('GETID3_LIBXML_OPTIONS') && defined('LIBXML_VERSION')) { 15 if(LIBXML_VERSION >= 20621) { 16 define('GETID3_LIBXML_OPTIONS', LIBXML_NOENT | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_COMPACT); 17 } else { 18 define('GETID3_LIBXML_OPTIONS', LIBXML_NOENT | LIBXML_NONET | LIBXML_NOWARNING); 19 } 20 } 14 21 15 22 class getid3_lib … … 304 311 } elseif (($exponent == 0) && ($fraction == 0)) { 305 312 if ($signbit == '1') { 306 $floatvalue = -0 ;313 $floatvalue = -0.0; 307 314 } else { 308 $floatvalue = 0; 309 } 310 $floatvalue = ($signbit ? 0 : -0); 315 $floatvalue = 0.0; 316 } 311 317 } elseif (($exponent == 0) && ($fraction != 0)) { 312 318 // These are 'unnormalized' values … … 733 739 // disabled by default, but is still needed when LIBXML_NOENT is used. 734 740 $loader = @libxml_disable_entity_loader(true); 735 $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT);741 $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', GETID3_LIBXML_OPTIONS); 736 742 $return = self::SimpleXMLelement2array($XMLobject); 737 743 @libxml_disable_entity_loader($loader); -
trunk/src/wp-includes/ID3/getid3.php
r52254 r54376 183 183 184 184 /** 185 * Use MD5 of source file if avail ble - only FLAC and OptimFROG185 * Use MD5 of source file if available - only FLAC and OptimFROG 186 186 * 187 187 * @var bool … … 388 388 protected $startup_warning = ''; 389 389 390 const VERSION = '1.9.2 1-202109171300';390 const VERSION = '1.9.22-202207161647'; 391 391 const FREAD_BUFFER_SIZE = 32768; 392 392 … … 394 394 const ATTACHMENTS_INLINE = true; 395 395 396 /** 397 * @throws getid3_exception 398 */ 396 399 public function __construct() { 397 400 … … 570 573 571 574 // remote files not supported 572 if (preg_match('#^(ht|f)tp ://#', $filename)) {575 if (preg_match('#^(ht|f)tps?://#', $filename)) { 573 576 throw new getid3_exception('Remote files are not supported - please copy the file locally first'); 574 577 } … … 1056 1059 ), 1057 1060 1058 // has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available 1059 // // MOD - audio - MODule (assorted sub-formats) 1060 // 'mod' => array( 1061 // 'pattern' => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)', 1062 // 'group' => 'audio', 1063 // 'module' => 'mod', 1064 // 'option' => 'mod', 1065 // 'mime_type' => 'audio/mod', 1066 // ), 1061 1062 // MOD - audio - MODule (SoundTracker) 1063 'mod' => array( 1064 //'pattern' => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)', // has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available 1065 'pattern' => '^.{1080}(M\\.K\\.)', 1066 'group' => 'audio', 1067 'module' => 'mod', 1068 'option' => 'mod', 1069 'mime_type' => 'audio/mod', 1070 ), 1067 1071 1068 1072 // MOD - audio - MODule (Impulse Tracker) … … 1095 1099 // MPC - audio - Musepack / MPEGplus 1096 1100 'mpc' => array( 1097 'pattern' => '^(MPCK|MP\\+ |[\\x00\\x01\\x10\\x11\\x40\\x41\\x50\\x51\\x80\\x81\\x90\\x91\\xC0\\xC1\\xD0\\xD1][\\x20-\\x37][\\x00\\x20\\x40\\x60\\x80\\xA0\\xC0\\xE0])',1101 'pattern' => '^(MPCK|MP\\+)', 1098 1102 'group' => 'audio', 1099 1103 'module' => 'mpc', … … 1550 1554 $GetFileFormatArray = $this->GetFileFormatArray(); 1551 1555 $info = $GetFileFormatArray['mp3']; 1556 $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; 1557 return $info; 1558 } elseif (preg_match('#\\.mp[cp\\+]$#i', $filename) && preg_match('#[\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0]#s', $filedata)) { 1559 // old-format (SV4-SV6) Musepack header that has a very loose pattern match and could falsely match other data (e.g. corrupt mp3) 1560 // only enable this pattern check if the filename ends in .mpc/mpp/mp+ 1561 $GetFileFormatArray = $this->GetFileFormatArray(); 1562 $info = $GetFileFormatArray['mpc']; 1552 1563 $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; 1553 1564 return $info; … … 2199 2210 return substr($this->data_string, $this->data_string_position - $bytes, $bytes); 2200 2211 } 2212 if ($bytes == 0) { 2213 return ''; 2214 } elseif ($bytes < 0) { 2215 throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().')', 10); 2216 } 2201 2217 $pos = $this->ftell() + $bytes; 2202 2218 if (!getid3_lib::intValueSupported($pos)) { -
trunk/src/wp-includes/ID3/module.audio-video.asf.php
r52254 r54376 21 21 class getid3_asf extends getid3_handler 22 22 { 23 protected static $ASFIndexParametersObjectIndexSpecifiersIndexTypes = array( 24 1 => 'Nearest Past Data Packet', 25 2 => 'Nearest Past Media Object', 26 3 => 'Nearest Past Cleanpoint' 27 ); 28 29 protected static $ASFMediaObjectIndexParametersObjectIndexSpecifiersIndexTypes = array( 30 1 => 'Nearest Past Data Packet', 31 2 => 'Nearest Past Media Object', 32 3 => 'Nearest Past Cleanpoint', 33 0xFF => 'Frame Number Offset' 34 ); 35 36 protected static $ASFTimecodeIndexParametersObjectIndexSpecifiersIndexTypes = array( 37 2 => 'Nearest Past Media Object', 38 3 => 'Nearest Past Cleanpoint' 39 ); 40 23 41 /** 24 42 * @param getID3 $getid3 … … 318 336 // shortcut 319 337 $thisfile_asf['codec_list_object'] = array(); 338 /** @var mixed[] $thisfile_asf_codeclistobject */ 320 339 $thisfile_asf_codeclistobject = &$thisfile_asf['codec_list_object']; 321 340 … … 333 352 } 334 353 $thisfile_asf_codeclistobject['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); 354 if ($thisfile_asf_codeclistobject['codec_entries_count'] > 0) { 355 $thisfile_asf_codeclistobject['codec_entries'] = array(); 356 } 335 357 $offset += 4; 336 358 for ($CodecEntryCounter = 0; $CodecEntryCounter < $thisfile_asf_codeclistobject['codec_entries_count']; $CodecEntryCounter++) { … … 529 551 $thisfile_asf_markerobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_markerobject['reserved']); 530 552 if ($thisfile_asf_markerobject['reserved'] != $this->GUIDtoBytestring('4CFEDB20-75F6-11CF-9C0F-00A0C90349CB')) { 531 $this->warning('marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved _1']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}');553 $this->warning('marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'); 532 554 break; 533 555 } … … 649 671 650 672 default: 651 $this->warning('error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject[' reserved']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}');673 $this->warning('error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['error_correction_type']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}'); 652 674 //return false; 653 675 break; … … 1443 1465 } 1444 1466 } 1445 $info['bitrate'] = (isset($thisfile_audio['bitrate']) ? $thisfile_audio['bitrate'] : 0) + (isset($thisfile_video['bitrate']) ? $thisfile_video['bitrate'] : 0);1467 $info['bitrate'] = 0 + (isset($thisfile_audio['bitrate']) ? $thisfile_audio['bitrate'] : 0) + (isset($thisfile_video['bitrate']) ? $thisfile_video['bitrate'] : 0); 1446 1468 1447 1469 if ((!isset($info['playtime_seconds']) || ($info['playtime_seconds'] <= 0)) && ($info['bitrate'] > 0)) { … … 1578 1600 'GETID3_ASF_Media_Object_Index_Object' => 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C', 1579 1601 'GETID3_ASF_Alt_Extended_Content_Encryption_Obj' => 'FF889EF1-ADEE-40DA-9E71-98704BB928CE', 1580 'GETID3_ASF_Index_Placeholder_Object' => 'D9AADE20-7C17-4F9C-BC28-8555DD98E2A2', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html 1581 'GETID3_ASF_Compatibility_Object' => '26F18B5D-4584-47EC-9F5F-0E651F0452C9', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html 1602 'GETID3_ASF_Index_Placeholder_Object' => 'D9AADE20-7C17-4F9C-BC28-8555DD98E2A2', // https://metacpan.org/dist/Audio-WMA/source/WMA.pm 1603 'GETID3_ASF_Compatibility_Object' => '26F18B5D-4584-47EC-9F5F-0E651F0452C9', // https://metacpan.org/dist/Audio-WMA/source/WMA.pm 1604 'GETID3_ASF_Media_Object_Index_Parameters_Object'=> '6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7', 1582 1605 ); 1583 1606 return $GUIDarray; … … 1742 1765 */ 1743 1766 public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) { 1744 // http ://msdn.microsoft.com/en-us/library/bb643323.aspx1767 // https://web.archive.org/web/20140419205228/http://msdn.microsoft.com/en-us/library/bb643323.aspx 1745 1768 1746 1769 $offset = 0; … … 1806 1829 $offset += 2; 1807 1830 1808 $thisObject['average_time_per_frame'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));1809 $offset += 4;1831 $thisObject['average_time_per_frame'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); 1832 $offset += 8; 1810 1833 1811 1834 $thisObject['stream_name_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); … … 1824 1847 $offset += 2; 1825 1848 1826 $streamName['stream_name'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, $streamName['stream_name_length']));1849 $streamName['stream_name'] = substr($asf_header_extension_object_data, $offset, $streamName['stream_name_length']); 1827 1850 $offset += $streamName['stream_name_length']; 1828 1851 … … 1846 1869 $offset += 4; 1847 1870 1848 $payloadExtensionSystem['extension_system_info _length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, $payloadExtensionSystem['extension_system_info_length']));1871 $payloadExtensionSystem['extension_system_info'] = substr($asf_header_extension_object_data, $offset, $payloadExtensionSystem['extension_system_info_length']); 1849 1872 $offset += $payloadExtensionSystem['extension_system_info_length']; 1850 1873 1851 1874 $thisObject['payload_extension_systems'][$i] = $payloadExtensionSystem; 1875 } 1876 1877 break; 1878 1879 case GETID3_ASF_Advanced_Mutual_Exclusion_Object: 1880 $thisObject['exclusion_type'] = substr($asf_header_extension_object_data, $offset, 16); 1881 $offset += 16; 1882 $thisObject['exclusion_type_text'] = $this->BytestringToGUID($thisObject['exclusion_type']); 1883 1884 $thisObject['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 1885 $offset += 2; 1886 1887 for ($i = 0; $i < $thisObject['stream_numbers_count']; $i++) { 1888 $thisObject['stream_numbers'][$i] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 1889 $offset += 2; 1890 } 1891 1892 break; 1893 1894 case GETID3_ASF_Stream_Prioritization_Object: 1895 $thisObject['priority_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 1896 $offset += 2; 1897 1898 for ($i = 0; $i < $thisObject['priority_records_count']; $i++) { 1899 $priorityRecord = array(); 1900 1901 $priorityRecord['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 1902 $offset += 2; 1903 1904 $priorityRecord['flags_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 1905 $offset += 2; 1906 $priorityRecord['flags']['mandatory'] = (bool) $priorityRecord['flags_raw'] & 0x00000001; 1907 1908 $thisObject['priority_records'][$i] = $priorityRecord; 1852 1909 } 1853 1910 … … 1969 2026 $thisObject['description_record'][$i] = $descriptionRecord; 1970 2027 } 2028 break; 2029 2030 case GETID3_ASF_Index_Parameters_Object: 2031 $thisObject['index_entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); 2032 $offset += 4; 2033 2034 $thisObject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2035 $offset += 2; 2036 2037 for ($i = 0; $i < $thisObject['index_specifiers_count']; $i++) { 2038 $indexSpecifier = array(); 2039 2040 $indexSpecifier['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2041 $offset += 2; 2042 2043 $indexSpecifier['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2044 $offset += 2; 2045 $indexSpecifier['index_type_text'] = isset(static::$ASFIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']]) 2046 ? static::$ASFIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']] 2047 : 'invalid' 2048 ; 2049 2050 $thisObject['index_specifiers'][$i] = $indexSpecifier; 2051 } 2052 2053 break; 2054 2055 case GETID3_ASF_Media_Object_Index_Parameters_Object: 2056 $thisObject['index_entry_count_interval'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); 2057 $offset += 4; 2058 2059 $thisObject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2060 $offset += 2; 2061 2062 for ($i = 0; $i < $thisObject['index_specifiers_count']; $i++) { 2063 $indexSpecifier = array(); 2064 2065 $indexSpecifier['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2066 $offset += 2; 2067 2068 $indexSpecifier['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2069 $offset += 2; 2070 $indexSpecifier['index_type_text'] = isset(static::$ASFMediaObjectIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']]) 2071 ? static::$ASFMediaObjectIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']] 2072 : 'invalid' 2073 ; 2074 2075 $thisObject['index_specifiers'][$i] = $indexSpecifier; 2076 } 2077 2078 break; 2079 2080 case GETID3_ASF_Timecode_Index_Parameters_Object: 2081 // 4.11 Timecode Index Parameters Object (mandatory only if TIMECODE index is present in file, 0 or 1) 2082 // Field name Field type Size (bits) 2083 // Object ID GUID 128 // GUID for the Timecode Index Parameters Object - ASF_Timecode_Index_Parameters_Object 2084 // Object Size QWORD 64 // Specifies the size, in bytes, of the Timecode Index Parameters Object. Valid values are at least 34 bytes. 2085 // Index Entry Count Interval DWORD 32 // This value is ignored for the Timecode Index Parameters Object. 2086 // Index Specifiers Count WORD 16 // Specifies the number of entries in the Index Specifiers list. Valid values are 1 and greater. 2087 // Index Specifiers array of: varies // 2088 // * Stream Number WORD 16 // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127. 2089 // * Index Type WORD 16 // Specifies the type of index. Values are defined as follows (1 is not a valid value): 2090 // 2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire video frame or the first fragment of a video frame 2091 // 3 = Nearest Past Cleanpoint - indexes point to the closest data packet containing an entire video frame (or first fragment of a video frame) that is a key frame. 2092 // Nearest Past Media Object is the most common value 2093 2094 $thisObject['index_entry_count_interval'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); 2095 $offset += 4; 2096 2097 $thisObject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2098 $offset += 2; 2099 2100 for ($i = 0; $i < $thisObject['index_specifiers_count']; $i++) { 2101 $indexSpecifier = array(); 2102 2103 $indexSpecifier['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2104 $offset += 2; 2105 2106 $indexSpecifier['index_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); 2107 $offset += 2; 2108 $indexSpecifier['index_type_text'] = isset(static::$ASFTimecodeIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']]) 2109 ? static::$ASFTimecodeIndexParametersObjectIndexSpecifiersIndexTypes[$indexSpecifier['index_type']] 2110 : 'invalid' 2111 ; 2112 2113 $thisObject['index_specifiers'][$i] = $indexSpecifier; 2114 } 2115 2116 break; 2117 2118 case GETID3_ASF_Compatibility_Object: 2119 $thisObject['profile'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 1)); 2120 $offset += 1; 2121 2122 $thisObject['mode'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 1)); 2123 $offset += 1; 2124 1971 2125 break; 1972 2126 -
trunk/src/wp-includes/ID3/module.audio-video.quicktime.php
r52254 r54376 62 62 $AtomHeader = $this->fread(8); 63 63 64 // https://github.com/JamesHeinrich/getID3/issues/382 65 // Atom sizes are stored as 32-bit number in most cases, but sometimes (notably for "mdat") 66 // a 64-bit value is required, in which case the normal 32-bit size field is set to 0x00000001 67 // and the 64-bit "real" size value is the next 8 bytes. 68 $atom_size_extended_bytes = 0; 64 69 $atomsize = getid3_lib::BigEndian2Int(substr($AtomHeader, 0, 4)); 65 70 $atomname = substr($AtomHeader, 4, 4); 66 67 // 64-bit MOV patch by jlegateØktnc*com68 71 if ($atomsize == 1) { 69 $atomsize = getid3_lib::BigEndian2Int($this->fread(8)); 72 $atom_size_extended_bytes = 8; 73 $atomsize = getid3_lib::BigEndian2Int($this->fread($atom_size_extended_bytes)); 70 74 } 71 75 … … 86 90 break; 87 91 } 88 89 92 $atomHierarchy = array(); 90 $parsedAtomData = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize , $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);93 $parsedAtomData = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize - $atom_size_extended_bytes, $atom_data_read_buffer_size)), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms); 91 94 $parsedAtomData['name'] = $atomname; 92 95 $parsedAtomData['size'] = $atomsize; 93 96 $parsedAtomData['offset'] = $offset; 97 if ($atom_size_extended_bytes) { 98 $parsedAtomData['xsize_bytes'] = $atom_size_extended_bytes; 99 } 94 100 if (in_array($atomname, array('uuid'))) { 95 101 @$info['quicktime'][$atomname][] = $parsedAtomData; … … 109 115 } 110 116 111 if ( !empty($info['quicktime']['comments']['chapters']) && is_array($info['quicktime']['comments']['chapters']) && (count($info['quicktime']['comments']['chapters']) > 0)) {117 if (isset($info['quicktime']['comments']['chapters']) && is_array($info['quicktime']['comments']['chapters']) && (count($info['quicktime']['comments']['chapters']) > 0)) { 112 118 $durations = $this->quicktime_time_to_sample_table($info); 113 119 for ($i = 0; $i < count($info['quicktime']['comments']['chapters']); $i++) { … … 260 266 switch ($atomname) { 261 267 case 'moov': // MOVie container atom 268 case 'moof': // MOvie Fragment box 262 269 case 'trak': // TRAcK container atom 270 case 'traf': // TRAck Fragment box 263 271 case 'clip': // CLIPping container atom 264 272 case 'matt': // track MATTe container atom … … 844 852 case 'gif ': 845 853 case 'h263': 854 case 'hvc1': 846 855 case 'jpeg': 847 856 case 'kpcd': … … 1542 1551 break; 1543 1552 1553 case 'ID32': // ID3v2 1554 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); 1555 1556 $getid3_temp = new getID3(); 1557 $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); 1558 $getid3_id3v2 = new getid3_id3v2($getid3_temp); 1559 $getid3_id3v2->StartingOffset = $atom_structure['offset'] + 14; // framelength(4)+framename(4)+flags(4)+??(2) 1560 if ($atom_structure['valid'] = $getid3_id3v2->Analyze()) { 1561 $atom_structure['id3v2'] = $getid3_temp->info['id3v2']; 1562 } else { 1563 $this->warning('ID32 frame at offset '.$atom_structure['offset'].' did not parse'); 1564 } 1565 unset($getid3_temp, $getid3_id3v2); 1566 break; 1567 1544 1568 case 'free': // FREE space atom 1545 1569 case 'skip': // SKIP atom … … 1701 1725 $atom_structure['unknown'] = getid3_lib::BigEndian2Int(substr($atom_data, 4 + 2, 2)); 1702 1726 $atom_structure['data'] = substr($atom_data, 4 + 4); 1703 $atom_structure['key_name'] = @$info['quicktime']['temp_meta_key_names'][$metaDATAkey++]; 1727 $atom_structure['key_name'] = (isset($info['quicktime']['temp_meta_key_names'][$metaDATAkey]) ? $info['quicktime']['temp_meta_key_names'][$metaDATAkey] : ''); 1728 $metaDATAkey++; 1704 1729 1705 1730 if ($atom_structure['key_name'] && $atom_structure['data']) { … … 2076 2101 break; 2077 2102 2103 2104 // AVIF-related - https://docs.rs/avif-parse/0.13.2/src/avif_parse/boxes.rs.html 2105 case 'pitm': // Primary ITeM 2106 case 'iloc': // Item LOCation 2107 case 'iinf': // Item INFo 2108 case 'iref': // Image REFerence 2109 case 'iprp': // Image PRoPerties 2110 $this->error('AVIF files not currently supported'); 2111 $atom_structure['data'] = $atom_data; 2112 break; 2113 2114 case 'tfdt': // Track Fragment base media Decode Time box 2115 case 'tfhd': // Track Fragment HeaDer box 2116 case 'mfhd': // Movie Fragment HeaDer box 2117 case 'trun': // Track fragment RUN box 2118 $this->error('fragmented mp4 files not currently supported'); 2119 $atom_structure['data'] = $atom_data; 2120 break; 2121 2122 case 'mvex': // MoVie EXtends box 2123 case 'pssh': // Protection System Specific Header box 2124 case 'sidx': // Segment InDeX box 2078 2125 default: 2079 2126 $this->warning('Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).'), '.$atomsize.' bytes at offset '.$baseoffset); … … 2324 2371 $QuicktimeVideoCodecLookup['h261'] = 'H261'; 2325 2372 $QuicktimeVideoCodecLookup['h263'] = 'H263'; 2373 $QuicktimeVideoCodecLookup['hvc1'] = 'H.265/HEVC'; 2326 2374 $QuicktimeVideoCodecLookup['IV41'] = 'Indeo4'; 2327 2375 $QuicktimeVideoCodecLookup['jpeg'] = 'JPEG'; -
trunk/src/wp-includes/ID3/module.audio-video.riff.php
r52254 r54376 809 809 $strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data']; 810 810 811 if (!isset($thisfile_riff_raw['strf'][$strhfccType][$streamindex])) { 812 $thisfile_riff_raw['strf'][$strhfccType][$streamindex] = null; 813 } 811 814 // shortcut 812 815 $thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex]; … … 1354 1357 $info['playtime_seconds'] = 0; 1355 1358 } 1356 if (isset($thisfile_riff_raw['strh'][0]['dwLength']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { 1359 if (isset($thisfile_riff_raw['strh'][0]['dwLength']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { // @phpstan-ignore-line 1357 1360 // needed for >2GB AVIs where 'avih' chunk only lists number of frames in that chunk, not entire movie 1358 1361 $info['playtime_seconds'] = $thisfile_riff_raw['strh'][0]['dwLength'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); 1359 } elseif (isset($thisfile_riff_raw['avih']['dwTotalFrames']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { 1362 } elseif (isset($thisfile_riff_raw['avih']['dwTotalFrames']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { // @phpstan-ignore-line 1360 1363 $info['playtime_seconds'] = $thisfile_riff_raw['avih']['dwTotalFrames'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); 1361 1364 } … … 1580 1583 $info = &$this->getid3->info; 1581 1584 1582 $RIFFchunk = false;1585 $RIFFchunk = array(); 1583 1586 $FoundAllChunksWeNeed = false; 1584 1587 $LISTchunkParent = null; … … 1935 1938 } 1936 1939 1937 return $RIFFchunk;1940 return !empty($RIFFchunk) ? $RIFFchunk : false; 1938 1941 } 1939 1942 -
trunk/src/wp-includes/ID3/module.audio.mp3.php
r52254 r54376 316 316 } 317 317 318 if (isset($thisfile_mpeg_audio['bitrate']) && $thisfile_mpeg_audio['bitrate'] === 'free') { 319 $encoder_options .= ' --freeformat'; 320 } 321 318 322 if (!empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']) || !empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'])) { 319 323 $encoder_options .= ' --nogap'; … … 751 755 752 756 // It the LAME tag was only introduced in LAME v3.90 753 // http://www.hydrogenaudio.org/?act=ST&f=15&t=9933 757 // https://wiki.hydrogenaud.io/index.php/LAME#VBR_header_and_LAME_tag 758 // https://hydrogenaud.io/index.php?topic=9933 754 759 755 760 // Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html … … 787 792 788 793 // bytes $A7-$AE Replay Gain 789 // http ://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html794 // https://web.archive.org/web/20021015212753/http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html 790 795 // bytes $A7-$AA : 32 bit floating point "Peak signal amplitude" 791 796 if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') { … … 915 920 916 921 // LAME CBR 917 if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1 ) {922 if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1 && $thisfile_mpeg_audio['bitrate'] !== 'free') { 918 923 919 924 $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; … … 1170 1175 $nextframetestarray = array('error' => array(), 'warning' => array(), 'avdataend' => $info['avdataend'], 'avdataoffset'=>$info['avdataoffset']); 1171 1176 if ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) { 1177 /** @phpstan-ignore-next-line */ 1172 1178 getid3_lib::safe_inc($info['mp3_validity_check_bitrates'][$nextframetestarray['mpeg']['audio']['bitrate']]); 1173 1179 if ($ScanAsCBR) { -
trunk/src/wp-includes/ID3/module.audio.ogg.php
r52254 r54376 187 187 $info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator']; 188 188 } 189 189 $this->warning('Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable'); 190 190 191 191 -
trunk/src/wp-includes/ID3/module.tag.id3v2.php
r52254 r54376 2065 2065 break; 2066 2066 case 'WXXX': 2067 list($subframe['chapter_url_description'], $subframe['chapter_url']) = explode("\x00", $encoding_converted_text, 2);2067 @list($subframe['chapter_url_description'], $subframe['chapter_url']) = explode("\x00", $encoding_converted_text, 2); 2068 2068 $parsedFrame['chapter_url'][$subframe['chapter_url_description']] = $subframe['chapter_url']; 2069 2069 $parsedFrame['subframes'][] = $subframe;
Note: See TracChangeset
for help on using the changeset viewer.