Fix typing in OC\Preview\Movie

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-02-24 14:55:13 +01:00
parent ebe731f014
commit d43dbfa0f2
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -120,25 +120,18 @@ class Movie extends ProviderV2 {
return $result;
}
/**
* @param int $maxX
* @param int $maxY
* @param string $absPath
* @param int $second
* @return null|\OCP\IImage
*/
private function generateThumbNail($maxX, $maxY, $absPath, $second): ?IImage {
private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $second): ?IImage {
$tmpPath = \OC::$server->getTempManager()->getTemporaryFile();
$binaryType = substr(strrchr($this->binary, '/'), 1);
if ($binaryType === 'avconv') {
$cmd = $this->binary . ' -y -ss ' . escapeshellarg($second) .
$cmd = $this->binary . ' -y -ss ' . escapeshellarg((string)$second) .
' -i ' . escapeshellarg($absPath) .
' -an -f mjpeg -vframes 1 -vsync 1 ' . escapeshellarg($tmpPath) .
' 2>&1';
} elseif ($binaryType === 'ffmpeg') {
$cmd = $this->binary . ' -y -ss ' . escapeshellarg($second) .
$cmd = $this->binary . ' -y -ss ' . escapeshellarg((string)$second) .
' -i ' . escapeshellarg($absPath) .
' -f mjpeg -vframes 1' .
' ' . escapeshellarg($tmpPath) .