Better Player queue completion limited by time

This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-30 20:56:01 +01:00
parent 949ab34b42
commit f7a12b09f7

View File

@ -156,14 +156,11 @@ class Player{
}
if($time > $this->timeout){
$this->close("timeout");
}else{
if($this->nextBuffer <= $time and strlen($this->buffer) > 0){
$this->sendBuffer();
}
}else{
if(!empty($this->queue)){
$cnt = 0;
while($cnt < 4){
$maxtime = $time + 0.025;
while(microtime(true) < $maxtime){
$p = array_shift($this->queue);
if($p === null){
break;
@ -179,6 +176,10 @@ class Player{
++$cnt;
}
}
if($this->nextBuffer <= $time and strlen($this->buffer) > 0){
$this->sendBuffer();
}
}
}