diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-11-24 16:03:07 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-11-24 16:03:07 +0300 |
commit | 168fce0b182e69d1364e4432178a8131961d6583 (patch) | |
tree | ab0b80f1d3df45aeae25183dd00231f1a5d7a7c4 /lib/private/preview | |
parent | 1b17429c1db8885227436d9f367b930b953e49af (diff) | |
parent | d15f1882f91c4ab71c8a41f62f5277bff5fa4ea6 (diff) |
Merge pull request #12303 from owncloud/windows-unknown-command-command
Deduplicate findBinaryPath() and do not try "command -v" on windows
Diffstat (limited to 'lib/private/preview')
-rw-r--r-- | lib/private/preview/movies.php | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/lib/private/preview/movies.php b/lib/private/preview/movies.php index 2a23c2141c1..d69266ceb33 100644 --- a/lib/private/preview/movies.php +++ b/lib/private/preview/movies.php @@ -8,28 +8,12 @@ */ namespace OC\Preview; -function findBinaryPath($program) { - exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode); - if ($returnCode === 0 && count($output) > 0) { - return escapeshellcmd($output[0]); - } - return null; -} - // movie preview is currently not supported on Windows if (!\OC_Util::runningOnWindows()) { - $isExecEnabled = \OC_Helper::is_function_enabled('exec'); - $ffmpegBinary = null; - $avconvBinary = null; - - if ($isExecEnabled) { - $avconvBinary = findBinaryPath('avconv'); - if (!$avconvBinary) { - $ffmpegBinary = findBinaryPath('ffmpeg'); - } - } + $avconvBinary = \OC_Helper::findBinaryPath('avconv'); + $ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg'); - if($isExecEnabled && ( $avconvBinary || $ffmpegBinary )) { + if ($avconvBinary || $ffmpegBinary) { class Movie extends Provider { public static $avconvBinary; |