Merge branch 'master' into patch-1

This commit is contained in:
Jens Hausdorf 2017-09-20 06:23:23 +02:00 committed by GitHub
commit 85f67937dc
5 changed files with 50 additions and 6 deletions

View file

@ -16,10 +16,15 @@ class Point
private $x;
private $y;
public function __construct($x, $y)
public function __construct($x, $y, $dynamic = false)
{
$this->x = (int) $x;
$this->y = (int) $y;
if ($dynamic) {
$this->x = $x;
$this->y = $y;
} else {
$this->x = (int)$x;
$this->y = (int)$y;
}
}
/**

View file

@ -170,6 +170,25 @@ class FFProbe
return $this->probe($pathfile, '-show_format', static::TYPE_FORMAT);
}
/**
* @api
*
* Checks wether the given `$pathfile` is considered a valid media file.
*
* @param string $pathfile
* @return bool
* @since 0.10.0
*/
public function isValid($pathfile)
{
try {
return $this->format($pathfile)->get('duration') > 0;
} catch(\Exception $e) {
// complete invalid data
return false;
}
}
/**
* @api
*