aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinvario <67800603+invario@users.noreply.github.com>2025-04-03 12:52:19 -0400
committerinvario <67800603+invario@users.noreply.github.com>2025-04-06 20:28:12 -0400
commiteb3ca406f89a98e96a7542f3caca6e6bec0879e3 (patch)
treee587c0ccf4e3a12a132be44faf215e26a852dfd4
parent91e2f05ee6aeaa978fec953455d7fcab20a07900 (diff)
downloadnextcloud-server-eb3ca406f89a98e96a7542f3caca6e6bec0879e3.tar.gz
nextcloud-server-eb3ca406f89a98e96a7542f3caca6e6bec0879e3.zip
feat(previews): fix casing and comments
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: invario <67800603+invario@users.noreply.github.com>
-rw-r--r--lib/private/Preview/Movie.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/Preview/Movie.php b/lib/private/Preview/Movie.php
index 1011eebe850..9ffda38b136 100644
--- a/lib/private/Preview/Movie.php
+++ b/lib/private/Preview/Movie.php
@@ -15,7 +15,7 @@ use OCP\Server;
use Psr\Log\LoggerInterface;
class Movie extends ProviderV2 {
- private Iconfig $config;
+ private IConfig $config;
/**
* @deprecated 23.0.0 pass option to \OCP\Preview\ProviderV2
@@ -127,8 +127,7 @@ class Movie extends ProviderV2 {
proc_close($test_hdr_proc);
// search build options for libzimg (provides zscale filter)
$ffmpeg_libzimg_installed = strpos($test_hdr_stderr, '--enable-libzimg');
- // Only values of "smpte2084" and "arib-std-b67" indicate an HDR video. Force colorspace to '2020_ncl'
- // because some videos are tagged incorrectly as 'reserved' resulting in fail.
+ // Only values of "smpte2084" and "arib-std-b67" indicate an HDR video.
// Only return true if video is detected as HDR and libzimg is installed.
if (($test_hdr_stdout === 'smpte2084' || $test_hdr_stdout === 'arib-std-b67') && $ffmpeg_libzimg_installed !== false) {
return true;
@@ -149,13 +148,15 @@ class Movie extends ProviderV2 {
$tmpPath];
} elseif ($binaryType === 'ffmpeg') {
if ($this->useHdr($absPath)) {
+ // Force colorspace to '2020_ncl' because some videos are
+ // tagged incorrectly as 'reserved' resulting in fail if not forced.
$cmd = [$this->binary, '-y', '-ss', (string)$second,
'-i', $absPath,
'-f', 'mjpeg', '-vframes', '1',
'-vf', 'zscale=min=2020_ncl:t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p',
$tmpPath];
} else {
- // alway default to generating preview using non-HDR command
+ // always default to generating preview using non-HDR command
$cmd = [$this->binary, '-y', '-ss', (string)$second,
'-i', $absPath,
'-f', 'mjpeg', '-vframes', '1',