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-12 11:58:47 +0200
commit6e9bccddf4e0852649535451ef60bce2f4c694ef (patch)
treeb7f82c17bcec8a4ee248e3bc584c6d2db18032a9
parent5cddf5a85d96aff232a14a3d336144a7c16204c3 (diff)
downloadnextcloud-server-backport/53000/stable31.tar.gz
nextcloud-server-backport/53000/stable31.zip
fix: unbloc ffmpeg on some broken videosbackport/53000/stable31
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 b6728dfb331..214daa15814 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 7db75eb2fd6..00192674a64 100644
--- a/lib/private/Preview/Movie.php
+++ b/lib/private/Preview/Movie.php
@@ -135,8 +135,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 d41b242945b..b63fef8b48d 100644
--- a/tests/lib/Preview/MovieTest.php
+++ b/tests/lib/Preview/MovieTest.php
@@ -15,6 +15,10 @@ namespace Test\Preview;
* @package Test\Preview
*/
class MovieTest extends Provider {
+ protected string $fileName = 'testimage.mp4';
+ protected int $width = 560;
+ protected int $height = 320;
+
protected function setUp(): void {
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
@@ -25,10 +29,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');