@@ -56,17 +56,17 @@ class Mp3Info {
5656 /**
5757 * @var array
5858 */
59- static private $ _bitRateTable ;
59+ private static $ _bitRateTable ;
6060
6161 /**
6262 * @var array
6363 */
64- static private $ _sampleRateTable ;
64+ private static $ _sampleRateTable ;
6565
6666 /**
6767 * @var array
6868 */
69- static private $ _vbrOffsets = [
69+ private static $ _vbrOffsets = [
7070 self ::MPEG_1 => [21 , 36 ],
7171 self ::MPEG_2 => [13 , 21 ],
7272 self ::MPEG_25 => [13 , 21 ],
@@ -77,6 +77,8 @@ class Mp3Info {
7777 */
7878 public static $ headerSeekLimit = 2048 ;
7979
80+ public static $ framesCountRead = 2 ;
81+
8082 /**
8183 * @var int MPEG codec version (1 or 2 or 2.5 or undefined)
8284 */
@@ -307,8 +309,11 @@ private function parseAudio($filename, $fileSize, $mode) {
307309 /**
308310 * First frame can lie. Need to fix in the future.
309311 * @link https://github.com/wapmorgan/Mp3Info/issues/13#issuecomment-447470813
312+ * Read first N frames
310313 */
311- $ framesCount = $ this ->readMpegFrame ($ fp );
314+ for ($ i = 0 ; $ i < self ::$ framesCountRead ; $ i ++) {
315+ $ framesCount = $ this ->readMpegFrame ($ fp );
316+ }
312317
313318 $ this ->_framesCount = $ framesCount !== null
314319 ? $ framesCount
0 commit comments