Make WordPress Core


Ignore:
Timestamp:
11/17/2025 10:20:32 PM (10 months ago)
Author:
desrosj
Message:

External Libraries: Update getID3 to version 1.9.24.

In [60812], two changes related to PHP 8.5 compatibility were cherry picked from the upstream repository to be included in time for WordPress 6.9. Since then, a proper release has been tagged which includes several bug fixes in addition to the previous two changes.

HEIF support has also been added to the Quicktime audio/video module.

A full list of changes can be found on GitHub: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.24

Props TobiasBg.
Fixes #64253.

File:
1 edited

Legend:

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

    r56975 r61253  
    306306
    307307                        if ($info['audio']['bitrate_mode'] == 'cbr') {
    308                                 $encoder_options = strtoupper($info['audio']['bitrate_mode']).round($info['audio']['bitrate'] / 1000);
     308                                if ($info['audio']['bitrate'] == 'free') {
     309                                        $encoder_options = strtoupper($info['audio']['bitrate_mode']);
     310                                } else {
     311                                        $encoder_options = strtoupper($info['audio']['bitrate_mode']).round($info['audio']['bitrate'] / 1000);
     312                                }
    309313                        } else {
    310314                                $encoder_options = strtoupper($info['audio']['bitrate_mode']);
     
    316320                }
    317321
    318                 if (isset($thisfile_mpeg_audio['bitrate']) && $thisfile_mpeg_audio['bitrate'] === 'free') {
     322                if (isset($thisfile_mpeg_audio['bitrate']) && ($thisfile_mpeg_audio['bitrate'] === 'free')) {
    319323                        $encoder_options .= ' --freeformat';
    320324                }
     
    713717                                                $info['audio']['bitrate'] = $framelengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144;
    714718                                        }
    715                                         $thisfile_mpeg_audio['framelength'] = floor($framelengthfloat);
     719                                        $thisfile_mpeg_audio['framelength'] = (int) floor($framelengthfloat);
    716720                                }
    717721
     
    920924
    921925                                                        // LAME CBR
    922                                                         if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1 && $thisfile_mpeg_audio['bitrate'] !== 'free') {
     926                                                        if (($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) && ($thisfile_mpeg_audio['bitrate'] !== 'free')) {
    923927
    924928                                                                $thisfile_mpeg_audio['bitrate_mode'] = 'cbr';
     
    11751179                        $nextframetestarray = array('error' => array(), 'warning' => array(), 'avdataend' => $info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);
    11761180                        if ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) {
    1177                                 /** @phpstan-ignore-next-line */
    11781181                                getid3_lib::safe_inc($info['mp3_validity_check_bitrates'][$nextframetestarray['mpeg']['audio']['bitrate']]);
    11791182                                if ($ScanAsCBR) {
     
    11871190                                // next frame is OK, get ready to check the one after that
    11881191                                if (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) {
    1189                                         $nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength'];
     1192                                        $nextframetestoffset += (int) $nextframetestarray['mpeg']['audio']['framelength'];
    11901193                                } else {
    11911194                                        $this->error('Frame at offset ('.$offset.') is has an invalid frame length.');
     
    17621765                if (empty($MPEGaudioBitrate)) {
    17631766                        $MPEGaudioBitrate = array (
    1764                                 '1'  =>  array (1 => array('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000),
    1765                                                                 2 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000),
    1766                                                                 3 => array('free', 32000, 40000, 48000,  56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000)
    1767                                                            ),
    1768 
    1769                                 '2'  =>  array (1 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000),
    1770                                                                 2 => array('free',  8000, 16000, 24000,  32000,  40000,  48000,  56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000),
    1771                                                            )
     1767                                '1' => array(
     1768                                        1 => array('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000),
     1769                                        2 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000),
     1770                                        3 => array('free', 32000, 40000, 48000,  56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000)
     1771                                ),
     1772                                '2' => array(
     1773                                        1 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000),
     1774                                        2 => array('free',  8000, 16000, 24000,  32000,  40000,  48000,  56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000),
     1775                                ),
    17721776                        );
    17731777                        $MPEGaudioBitrate['2'][3] = $MPEGaudioBitrate['2'][2];
Note: See TracChangeset for help on using the changeset viewer.