aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Preview/Movie.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Preview/Movie.php')
-rw-r--r--lib/private/Preview/Movie.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/Preview/Movie.php b/lib/private/Preview/Movie.php
index 46462dfa592..47895f999d8 100644
--- a/lib/private/Preview/Movie.php
+++ b/lib/private/Preview/Movie.php
@@ -54,10 +54,15 @@ class Movie extends ProviderV2 {
$result = null;
if ($this->useTempFile($file)) {
- // try downloading 5 MB first as it's likely that the first frames are present there
- // in some cases this doesn't work for example when the moov atom is at the
- // end of the file, so if it fails we fall back to getting the full file
- $sizeAttempts = [5242880, null];
+ // Try downloading 5 MB first, as it's likely that the first frames are present there.
+ // In some cases this doesn't work, for example when the moov atom is at the
+ // end of the file, so if it fails we fall back to getting the full file.
+ // Unless the file is not local (e.g. S3) as we do not want to download the whole (e.g. 37Gb) file
+ if ($file->getStorage()->isLocal()) {
+ $sizeAttempts = [5242880, null];
+ } else {
+ $sizeAttempts = [5242880];
+ }
} else {
// size is irrelevant, only attempt once
$sizeAttempts = [null];
@@ -161,8 +166,8 @@ class Movie extends ProviderV2 {
$returnCode = -1;
$output = '';
if (is_resource($proc)) {
- $stdout = trim(stream_get_contents($pipes[1]));
$stderr = trim(stream_get_contents($pipes[2]));
+ $stdout = trim(stream_get_contents($pipes[1]));
$returnCode = proc_close($proc);
$output = $stdout . $stderr;
}