summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/stream.class.php15
-rw-r--r--play/index.php6
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 66ecc42c..f2420cbe 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -135,14 +135,13 @@ class Stream {
debug_event('downsample', "Downsample command: $command", 3);
- $process = proc_open(
- $command,
- array(
- 1 => array('pipe', 'w'),
- 2 => array('pipe', 'w')
- ),
- $pipes
- );
+ $descriptors = array(1 => array('pipe', 'w'));
+ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
+ // Windows doesn't like to provide stderr as a pipe
+ $descriptors[2] = array('pipe', 'w');
+ }
+
+ $process = proc_open($command, $descriptors, $pipes);
return array(
'process' => $process,
'handle' => $pipes[1],
diff --git a/play/index.php b/play/index.php
index 1b4c4abf..b0980307 100644
--- a/play/index.php
+++ b/play/index.php
@@ -467,8 +467,10 @@ else {
if ($demo_id) { $democratic->delete_from_oid($oid,'song'); }
if ($transcode) {
- $stderr = fread($transcoder['stderr'], 8192);
- fclose($transcoder['stderr']);
+ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
+ $stderr = fread($transcoder['stderr'], 8192);
+ fclose($transcoder['stderr']);
+ }
fclose($fp);
proc_close($transcoder['process']);
debug_event('transcode_cmd', $stderr, 5);