Skip to content

Commit cb8c152

Browse files
jpsn123susnux
andcommitted
fix(previews): movie preview bug fix, in some case stream reading functions may block indefinitly
Signed-off-by: cn-shell <jpsn@foxmail.com> Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 97df391 commit cb8c152

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/private/Preview/Movie.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $s
343343
$returnCode = -1;
344344
$output = '';
345345
if (is_resource($proc)) {
346+
stream_set_blocking($pipes[1], false);
347+
stream_set_blocking($pipes[2], false);
346348
// Read stderr before stdout: ffmpeg's stderr can exceed 64KB (OS pipe buffer) for certain
347349
// files, causing a deadlock if stdout is read first. stdout is always empty.
348350
$stderr = trim(stream_get_contents($pipes[2]));

0 commit comments

Comments
 (0)