Skip to content

Commit 14caffc

Browse files
authored
Merge pull request #43226 from jpsn123/master
movie preview bug fix, in some case stream reading functions may block indefinitely
2 parents 32387e1 + cb8c152 commit 14caffc

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)