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>
pull/43226/head
cn-shell 1 year ago committed by Ferdinand Thiessen
parent 97df391969
commit cb8c152ed3
No known key found for this signature in database
GPG Key ID: 7E849AE05218500F
  1. 2
      lib/private/Preview/Movie.php

@ -343,6 +343,8 @@ class Movie extends ProviderV2 {
$returnCode = -1;
$output = '';
if (is_resource($proc)) {
stream_set_blocking($pipes[1], false);
stream_set_blocking($pipes[2], false);
// 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]));

Loading…
Cancel
Save