mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #60916 from adduxa/fix/previews/ffprobe-hangs
fix(previews): ffprobe hangs
This commit is contained in:
commit
22ed3c3d15
2 changed files with 6 additions and 1 deletions
1
AUTHORS
1
AUTHORS
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -289,8 +289,10 @@ class Movie extends ProviderV2 {
|
|||
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');
|
||||
|
|
@ -341,6 +343,8 @@ class Movie extends ProviderV2 {
|
|||
$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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue