Fix Invalid ratio computing
This commit is contained in:
parent
9b87e44505
commit
c722665482
3 changed files with 24 additions and 1 deletions
|
|
@ -89,7 +89,12 @@ class Stream extends AbstractData
|
|||
if ($stream->has($name)) {
|
||||
$ratio = $stream->get($name);
|
||||
if (preg_match('/\d+:\d+/', $ratio)) {
|
||||
return array_map(function ($int) { return (int) $int; }, explode(':', $ratio));
|
||||
$data = array_filter(explode(':', $ratio), function ($int) {
|
||||
return $int > 0;
|
||||
});
|
||||
if (2 === count($data)) {
|
||||
return array_map(function ($int) { return (int) $int; }, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue