Make WordPress Core


Ignore:
Timestamp:
04/20/2020 11:11:48 AM (5 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update getID3() to 1.9.19.

Changelog: https://github.com/JamesHeinrich/getID3/compare/v1.9.18...v1.9.19

Props ayeshrajans, schlessera.
See #49945.

File:
1 edited

Legend:

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

    r46586 r47601  
    720720                    $thisfile_mpeg_audio_lame['long_version']  = substr($headerstring, $VBRidOffset + 120, 20);
    721721                    $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
    724733
    725734                        // extra 11 chars are not part of version string when LAMEtag present
     
    13251334                            $this->fseek(-4, SEEK_CUR);
    13261335
    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) {
    13331342                                $pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']);
    13341343                                $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.');
Note: See TracChangeset for help on using the changeset viewer.