Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- Andreas Pflug <dev@admin4.org>
- Andrew Brown <andrew@casabrown.com>
- Andrey Borysenko <andrey.borysenko@nextcloud.com>
- Andrey Dyakov <adduxa@gmail.com>
- André Gaul <gaul@web-yard.de>
- Andy Xheli <axheli@axtsolutions.com>
- Anna Larch <anna@nextcloud.com>
Expand Down
6 changes: 5 additions & 1 deletion lib/private/Preview/Movie.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ private function useHdr(string $absPath): bool {
if ($test_hdr_proc === false) {
return false;
}
$test_hdr_stdout = trim(stream_get_contents($test_hdr_pipes[1]));
// Read stderr before stdout: ffprobe's stderr can exceed 64KB (OS pipe buffer) for certain
// files, causing a deadlock if stdout is read first. stdout is always a short string.
$test_hdr_stderr = trim(stream_get_contents($test_hdr_pipes[2]));
$test_hdr_stdout = trim(stream_get_contents($test_hdr_pipes[1]));
proc_close($test_hdr_proc);
// search build options for libzimg (provides zscale filter)
$ffmpeg_libzimg_installed = strpos($test_hdr_stderr, '--enable-libzimg');
Expand Down Expand Up @@ -341,6 +343,8 @@ private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $s
$returnCode = -1;
$output = '';
if (is_resource($proc)) {
// Read stderr before stdout: ffmpeg's stderr can exceed 64KB (OS pipe buffer) for certain
// files, causing a deadlock if stdout is read first. stdout is always empty.
$stderr = trim(stream_get_contents($pipes[2]));
$stdout = trim(stream_get_contents($pipes[1]));
$returnCode = proc_close($proc);
Expand Down
Loading