aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2025-05-20 18:14:30 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2025-06-13 13:19:33 +0200
commit3bb3fc2169fb9b8353e5a6e976801d604b364eb1 (patch)
tree6e009036f7ceee8c8faeedd86fb10702120b796f
parenta591318736f6c21b638d47ec4bdaae9b2fd374eb (diff)
downloadnextcloud-server-backport/53000/stable30.tar.gz
nextcloud-server-backport/53000/stable30.zip
fix: unbloc ffmpeg on some broken videosbackport/53000/stable30
Co-authored-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--.reuse/dep52
-rw-r--r--lib/private/Preview/Movie.php2
-rw-r--r--tests/data/broken-video.webmbin0 -> 1714189 bytes
-rw-r--r--tests/lib/Preview/MovieBrokenStuckFfmpegTest.php20
-rw-r--r--tests/lib/Preview/MovieTest.php9
5 files changed, 27 insertions, 6 deletions
diff --git a/.reuse/dep5 b/.reuse/dep5
index 4320fe5bd01..e47bb6c42cb 100644
--- a/.reuse/dep5
+++ b/.reuse/dep5
@@ -107,7 +107,7 @@ Files: tests/data/integritycheck/htaccessWithValidModifiedContent/.htaccess
Copyright: 2016 ownCloud, Inc., 2019 Nextcloud GmbH and Nextcloud contributors
License: AGPL-3.0-only
-Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp apps/testing/img/logo.png core/img/apps/spreed.svg
+Files: core/img/favicon*.* core/img/logo/logo*.* tests/data/testimage.webp tests/data/broken-video.webm apps/testing/img/logo.png core/img/apps/spreed.svg
Copyright: 2016-2024 Nextcloud GmbH
License: LicenseRef-NextcloudTrademarks
diff --git a/lib/private/Preview/Movie.php b/lib/private/Preview/Movie.php
index 7b7d6fe40e8..e52aa392c20 100644
--- a/lib/private/Preview/Movie.php
+++ b/lib/private/Preview/Movie.php
@@ -122,8 +122,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;
}
diff --git a/tests/data/broken-video.webm b/tests/data/broken-video.webm
new file mode 100644
index 00000000000..0cafb9314f8
--- /dev/null
+++ b/tests/data/broken-video.webm
Binary files differ
diff --git a/tests/lib/Preview/MovieBrokenStuckFfmpegTest.php b/tests/lib/Preview/MovieBrokenStuckFfmpegTest.php
new file mode 100644
index 00000000000..e66d5e64649
--- /dev/null
+++ b/tests/lib/Preview/MovieBrokenStuckFfmpegTest.php
@@ -0,0 +1,20 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace Test\Preview;
+
+/**
+ * Class MovieTest
+ *
+ * @group DB
+ *
+ * @package Test\Preview
+ */
+class MovieBrokenStuckFfmpegTest extends MovieTest {
+ protected string $fileName = 'broken-video.webm';
+}
diff --git a/tests/lib/Preview/MovieTest.php b/tests/lib/Preview/MovieTest.php
index 5acd951a644..79972f29b32 100644
--- a/tests/lib/Preview/MovieTest.php
+++ b/tests/lib/Preview/MovieTest.php
@@ -16,6 +16,10 @@ namespace Test\Preview;
* @package Test\Preview
*/
class MovieTest extends Provider {
+ protected string $fileName = 'testimage.mp4';
+ protected $width = 560;
+ protected $height = 320;
+
protected function setUp(): void {
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
@@ -26,10 +30,7 @@ class MovieTest extends Provider {
\OC\Preview\Movie::$avconvBinary = $avconvBinary;
\OC\Preview\Movie::$ffmpegBinary = $ffmpegBinary;
- $fileName = 'testimage.mp4';
- $this->imgPath = $this->prepareTestFile($fileName, \OC::$SERVERROOT . '/tests/data/' . $fileName);
- $this->width = 560;
- $this->height = 320;
+ $this->imgPath = $this->prepareTestFile($this->fileName, \OC::$SERVERROOT . '/tests/data/' . $this->fileName);
$this->provider = new \OC\Preview\Movie;
} else {
$this->markTestSkipped('No Movie provider present');