Make WordPress Core


Ignore:
Timestamp:
09/14/2019 07:06:09 PM (7 years ago)
Author:
jorbin
Message:

Update getID3 library to fix issues with PHP7.4

Updates to trunk version that includes fixes for PHP7.4

Changelog:
​https://github.com/JamesHeinrich/getID3/compare/v1.9.14...00f3fbfd77e583099ca70a3cf0bc092e113d2b20

See: #47751,#47783.
Fixes: #48040.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ID3/module.audio.dts.php

    r32979 r46112  
    11<?php
     2
    23/////////////////////////////////////////////////////////////////
    34/// 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                            //
    99/////////////////////////////////////////////////////////////////
    1010//                                                             //
    … …  
    2222{
    2323        /**
    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         */
    2831        private $readBinDataOffset = 0;
    2932
    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         */
    3945        public function Analyze() {
    4046                $info = &$this->getid3->info;
    … …  
    4652                // check syncword
    4753                $sync = substr($DTSheader, 0, 4);
    48         if (($encoding = array_search($sync, self::$syncwords)) !== false) {
    49 
    50                 $info['dts']['raw']['magic'] = $sync;
     54                if (($encoding = array_search($sync, self::$syncwords)) !== false) {
     55
     56                        $info['dts']['raw']['magic'] = $sync;
    5157                        $this->readBinDataOffset = 32;
    5258
    53         } elseif ($this->isDependencyFor('matroska')) {
     59                } elseif ($this->isDependencyFor('matroska')) {
    5460
    5561                        // Matroska contains DTS without syncword encoded as raw big-endian format
    … …  
    5763                        $this->readBinDataOffset = 0;
    5864
    59         } else {
     65                } else {
    6066
    6167                        unset($info['fileformat']);
    … …  
    140146        }
    141147
     148        /**
     149         * @param string $bin
     150         * @param int $length
     151         *
     152         * @return float|int
     153         */
    142154        private function readBinData($bin, $length) {
    143155                $data = substr($bin, $this->readBinDataOffset, $length);
    … …  
    147159        }
    148160
     161        /**
     162         * @param int $index
     163         *
     164         * @return int|string|false
     165         */
    149166        public static function bitrateLookup($index) {
    150167                static $lookup = array(
    … …  
    185202        }
    186203
     204        /**
     205         * @param int $index
     206         *
     207         * @return int|string|false
     208         */
    187209        public static function sampleRateLookup($index) {
    188210                static $lookup = array(
    … …  
    207229        }
    208230
     231        /**
     232         * @param int $index
     233         *
     234         * @return int|false
     235         */
    209236        public static function bitPerSampleLookup($index) {
    210237                static $lookup = array(
    … …  
    217244        }
    218245
     246        /**
     247         * @param int $index
     248         *
     249         * @return int|false
     250         */
    219251        public static function numChannelsLookup($index) {
    220252                switch ($index) {
    … …  
    255287        }
    256288
     289        /**
     290         * @param int $index
     291         *
     292         * @return string
     293         */
    257294        public static function channelArrangementLookup($index) {
    258295                static $lookup = array(
    … …  
    277314        }
    278315
     316        /**
     317         * @param int $index
     318         * @param int $version
     319         *
     320         * @return int|false
     321         */
    279322        public static function dialogNormalization($index, $version) {
    280323                switch ($version) {
Note: See TracChangeset for help on using the changeset viewer.