mirror of
https://github.com/koel/koel
synced 2024-11-24 05:03:05 +00:00
Optimize PHPStreamer (closes #708)
This commit is contained in:
parent
cdf9faafbf
commit
e11e9d1392
1 changed files with 10 additions and 5 deletions
|
@ -46,12 +46,17 @@ class PHPStreamer extends Streamer implements StreamerInterface
|
|||
|
||||
if ($range[0] === '') {
|
||||
// First number missing, return last $range[1] bytes
|
||||
$end = $fileSize - 1;
|
||||
$start = $end - (int) $range[0];
|
||||
$start = $end = $fileSize - 1;
|
||||
} elseif ($range[1] === '') {
|
||||
// Second number missing, return from byte $range[0] to end
|
||||
$start = (int) $range[0];
|
||||
$end = $fileSize - 1;
|
||||
if ($range[0] === 0) {
|
||||
$start = 0;
|
||||
$end = $fileSize - 1;
|
||||
$partial = false;
|
||||
} else {
|
||||
// Second number missing, return from byte $range[0] to end
|
||||
$start = (int) $range[0];
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
} else {
|
||||
// Both numbers present, return specific range
|
||||
$start = (int) $range[0];
|
||||
|
|
Loading…
Reference in a new issue