Changeset 61253 for trunk/src/wp-includes/ID3/module.audio.mp3.php
- Timestamp:
- 11/17/2025 10:20:32 PM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/ID3/module.audio.mp3.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/module.audio.mp3.php
r56975 r61253 306 306 307 307 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 } 309 313 } else { 310 314 $encoder_options = strtoupper($info['audio']['bitrate_mode']); … … 316 320 } 317 321 318 if (isset($thisfile_mpeg_audio['bitrate']) && $thisfile_mpeg_audio['bitrate'] === 'free') {322 if (isset($thisfile_mpeg_audio['bitrate']) && ($thisfile_mpeg_audio['bitrate'] === 'free')) { 319 323 $encoder_options .= ' --freeformat'; 320 324 } … … 713 717 $info['audio']['bitrate'] = $framelengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144; 714 718 } 715 $thisfile_mpeg_audio['framelength'] = floor($framelengthfloat);719 $thisfile_mpeg_audio['framelength'] = (int) floor($framelengthfloat); 716 720 } 717 721 … … 920 924 921 925 // 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')) { 923 927 924 928 $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; … … 1175 1179 $nextframetestarray = array('error' => array(), 'warning' => array(), 'avdataend' => $info['avdataend'], 'avdataoffset'=>$info['avdataoffset']); 1176 1180 if ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) { 1177 /** @phpstan-ignore-next-line */1178 1181 getid3_lib::safe_inc($info['mp3_validity_check_bitrates'][$nextframetestarray['mpeg']['audio']['bitrate']]); 1179 1182 if ($ScanAsCBR) { … … 1187 1190 // next frame is OK, get ready to check the one after that 1188 1191 if (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) { 1189 $nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength'];1192 $nextframetestoffset += (int) $nextframetestarray['mpeg']['audio']['framelength']; 1190 1193 } else { 1191 1194 $this->error('Frame at offset ('.$offset.') is has an invalid frame length.'); … … 1762 1765 if (empty($MPEGaudioBitrate)) { 1763 1766 $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 ), 1772 1776 ); 1773 1777 $MPEGaudioBitrate['2'][3] = $MPEGaudioBitrate['2'][2];
Note: See TracChangeset
for help on using the changeset viewer.