phi_remove_001.phpt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. --TEST--
  2. Phi sources remove 001
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.optimization_level=-1
  7. --EXTENSIONS--
  8. opcache
  9. --FILE--
  10. <?php
  11. function getOnlyMPEGaudioInfoBruteForce($info) {
  12. $Distribution['bitrate'] = array();
  13. $Distribution['frequency'] = array();
  14. $Distribution['layer'] = array();
  15. $Distribution['version'] = array();
  16. $Distribution['padding'] = array();
  17. $max_frames_scan = 5000;
  18. $frames_scanned = 0;
  19. $previousvalidframe = $info['avdataoffset'];
  20. while ($info) {
  21. if (!isset($MPEGaudioHeaderDecodeCache[$head4])) {
  22. $MPEGaudioHeaderDecodeCache[$head4] = MPEGaudioHeaderDecode($head4);
  23. }
  24. if (!isset($MPEGaudioHeaderValidCache[$head4])) {
  25. $MPEGaudioHeaderValidCache[$head4] = MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$head4], false, false);
  26. }
  27. if ($MPEGaudioHeaderValidCache[$head4]) {
  28. if ($MPEGaudioHeaderLengthCache[$head4] > 4) {
  29. $WhereWeWere = mftell();
  30. $next4 = test(4);
  31. if ($next4[0] == "\xFF") {
  32. if (!isset($MPEGaudioHeaderDecodeCache[$next4])) {
  33. $MPEGaudioHeaderDecodeCache[$next4] = MPEGaudioHeaderDecode($next4);
  34. }
  35. if (!isset($MPEGaudioHeaderValidCache[$next4])) {
  36. $MPEGaudioHeaderValidCache[$next4] = MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false);
  37. }
  38. if ($MPEGaudioHeaderValidCache[$next4]) {
  39. getid3_lib::safe_inc($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]);
  40. getid3_lib::safe_inc($Distribution['layer'][$LongMPEGlayerLookup[$head4]]);
  41. getid3_lib::safe_inc($Distribution['version'][$LongMPEGversionLookup[$head4]]);
  42. getid3_lib::safe_inc($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]);
  43. getid3_lib::safe_inc($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]);
  44. if ($max_frames_scan && (++$frames_scanned >= $max_frames_scan)) {
  45. foreach ($Distribution as $key1 => $value1) {
  46. foreach ($value1 as $key2 => $value2) {
  47. $Distribution[$key1][$key2] = round($value2 / $pct_data_scanned);
  48. }
  49. }
  50. break;
  51. }
  52. continue;
  53. }
  54. }
  55. unset($next4);
  56. }
  57. }
  58. }
  59. return true;
  60. }
  61. ?>
  62. okey
  63. --EXPECT--
  64. okey