Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions src/PHPVideoToolkit/ExecBuffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,25 +230,26 @@ public function getRunTime()
*/
protected function _run($callback)
{
// get the buffer regardless of wether or not there is a callback as it updates and
// checks for the completion of the command.
$buffer = $this->getBuffer();

// get the buffer to give to the
if($callback !== null && is_callable($callback) === true)
{
call_user_func($callback, $this, $buffer, false);
}

// if we have finished running the loop then break here.
if($this->_running === false)
{
return;
while($this->_running !== false) {
// get the buffer regardless of wether or not there is a callback as it updates and
// checks for the completion of the command.
$buffer = $this->getBuffer();

// get the buffer to give to the
if($callback !== null && is_callable($callback) === true)
{
call_user_func($callback, $this, $buffer, false);
}

// if we have finished running the loop then break here.
if($this->_running === false)
{
break;
}

// still running so wait and then run again.
$this->wait($this->_callback_period_interval);
}

// still running so wait and then run again.
$this->wait($this->_callback_period_interval);
$this->_run($callback);
}

/**
Expand Down