wp-includes/ID3/module.audio-video.matroska.php:232$hide_clustersboolpublic$parse_whole_fileboolpublic$EBMLbufferprivate$EBMLbuffer_offsetprivate$EBMLbuffer_lengthprivate$current_offsetprivate$unuseful_elementsprivate$scan_modeprivateclass getid3_matroska extends getid3_handler{ /** * If true, do not return information about CLUSTER chunks, since there's a lot of them * and they're not usually useful [default: TRUE]. * * @var bool */ public $hide_clusters = true; /** * True to parse the whole file, not only header [default: FALSE]. * * @var bool */ public $parse_whole_file = false; /* * Private parser settings/placeholders. */ private $EBMLbuffer = ''; private $EBMLbuffer_offset = 0; private $EBMLbuffer_length = 0; private $current_offset = 0; private $unuseful_elements = array(EBML_ID_CRC32, EBML_ID_VOID); private $scan_mode = MATROSKA_SCAN_HEADER; /** * @return bool */ public function Analyze() { $info = &$this->getid3->info; $this->scan_mode = $this->parse_whole_file ? MATROSKA_SCAN_WHOLE_FILE : MATROSKA_SCAN_HEADER; // parse container try { $this->parseEBML($info); } catch (Exception $e) { $this->error('EBML parser: '.$e->getMessage()); } $this->playtimeFromMetadata($info); // If there was no duration metadata, this might be an incomplete file or a streaming file // We need Cluster information so we can use their timecodes to estimate playtime. if (!isset($info['playtime_seconds']) && !$this->parse_whole_file) { // Scan the start and end of file for Clusters to estimate duration $this->scanStartEndForClusters($info); } if (isset($info['matroska']['cluster']) && is_array($info['matroska']['cluster'])) { if (!isset($info['playtime_seconds']) && !empty($info['matroska']['cluster'])) { // estimate playtime using clusters if not yet known $this->calculatePlaytimeFromClusters($info); } // Remove cluster information from output if hide_clusters is true // These could have been set during scanStartEndForClusters() if ($this->hide_clusters) { unset($info['matroska']['cluster']); } } // extract tags if (isset($info['matroska']['tags']) && is_array($info['matroska']['tags'])) { foreach ($info['matroska']['tags'] as $key => $infoarray) { $this->ExtractCommentsSimpleTag($infoarray); } } // process tracks if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) { foreach ($info['matroska']['tracks']['tracks'] as $key => $trackarray) { $track_info = array(); $track_info['dataformat'] = self::CodecIDtoCommonName($trackarray['CodecID']); $track_info['default'] = (isset($trackarray['FlagDefault']) ? $trackarray['FlagDefault'] : true); if (isset($trackarray['Name'])) { $track_info['name'] = $trackarray['Name']; }5 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
playtimeFromMetadata() added.verified against sourceresetParserBuffer() added.verified against sourcescanStartEndForClusters() added.verified against sourcegetTimecodeScale() added.verified against sourcecalculatePlaytimeFromClusters() added.verified against sourcesrc/wp-includes/ID3/module.audio-video.matroska.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.