浏览代码

reduce stdout redirection

Luke Pulverenti 9 年之前
父节点
当前提交
22601f0a2e

+ 2 - 2
MediaBrowser.Api/Playback/BaseStreamingService.cs

@@ -996,7 +996,7 @@ namespace MediaBrowser.Api.Playback
                     UseShellExecute = false,
                     UseShellExecute = false,
 
 
                     // Must consume both stdout and stderr or deadlocks may occur
                     // Must consume both stdout and stderr or deadlocks may occur
-                    RedirectStandardOutput = true,
+                    //RedirectStandardOutput = true,
                     RedirectStandardError = true,
                     RedirectStandardError = true,
                     RedirectStandardInput = true,
                     RedirectStandardInput = true,
 
 
@@ -1063,7 +1063,7 @@ namespace MediaBrowser.Api.Playback
             }
             }
 
 
             // MUST read both stdout and stderr asynchronously or a deadlock may occurr
             // MUST read both stdout and stderr asynchronously or a deadlock may occurr
-            process.BeginOutputReadLine();
+            //process.BeginOutputReadLine();
 
 
             // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
             // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
             Task.Run(() => StartStreamingLog(transcodingJob, state, process.StandardError.BaseStream, state.LogFileStream));
             Task.Run(() => StartStreamingLog(transcodingJob, state, process.StandardError.BaseStream, state.LogFileStream));

+ 2 - 2
MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs

@@ -81,7 +81,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     UseShellExecute = false,
                     UseShellExecute = false,
 
 
                     // Must consume both stdout and stderr or deadlocks may occur
                     // Must consume both stdout and stderr or deadlocks may occur
-                    RedirectStandardOutput = true,
+                    //RedirectStandardOutput = true,
                     RedirectStandardError = true,
                     RedirectStandardError = true,
                     RedirectStandardInput = true,
                     RedirectStandardInput = true,
 
 
@@ -133,7 +133,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
             cancellationToken.Register(() => Cancel(process, encodingJob));
             cancellationToken.Register(() => Cancel(process, encodingJob));
 
 
             // MUST read both stdout and stderr asynchronously or a deadlock may occurr
             // MUST read both stdout and stderr asynchronously or a deadlock may occurr
-            process.BeginOutputReadLine();
+            //process.BeginOutputReadLine();
 
 
             // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
             // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
             new JobLogger(Logger).StartStreamingLog(encodingJob, process.StandardError.BaseStream, encodingJob.LogFileStream);
             new JobLogger(Logger).StartStreamingLog(encodingJob, process.StandardError.BaseStream, encodingJob.LogFileStream);

+ 4 - 4
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -482,7 +482,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     UseShellExecute = false,
                     UseShellExecute = false,
 
 
                     // Must consume both or ffmpeg may hang due to deadlocks. See comments below.   
                     // Must consume both or ffmpeg may hang due to deadlocks. See comments below.   
-                    RedirectStandardOutput = true,
+                    //RedirectStandardOutput = true,
                     RedirectStandardError = true,
                     RedirectStandardError = true,
                     RedirectStandardInput = true,
                     RedirectStandardInput = true,
                     FileName = FFProbePath,
                     FileName = FFProbePath,
@@ -517,7 +517,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
 
 
                 try
                 try
                 {
                 {
-                    process.BeginErrorReadLine();
+                    //process.BeginErrorReadLine();
 
 
                     var result = _jsonSerializer.DeserializeFromStream<InternalMediaInfoResult>(process.StandardOutput.BaseStream);
                     var result = _jsonSerializer.DeserializeFromStream<InternalMediaInfoResult>(process.StandardOutput.BaseStream);
 
 
@@ -612,7 +612,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     UseShellExecute = false,
                     UseShellExecute = false,
 
 
                     // Must consume both or ffmpeg may hang due to deadlocks. See comments below.   
                     // Must consume both or ffmpeg may hang due to deadlocks. See comments below.   
-                    RedirectStandardOutput = true,
+                    //RedirectStandardOutput = true,
                     RedirectStandardError = true,
                     RedirectStandardError = true,
                     RedirectStandardInput = true,
                     RedirectStandardInput = true,
                     FileName = FFMpegPath,
                     FileName = FFMpegPath,
@@ -643,7 +643,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
 
 
                 try
                 try
                 {
                 {
-                    process.BeginOutputReadLine();
+                    //process.BeginOutputReadLine();
 
 
                     using (var reader = new StreamReader(process.StandardError.BaseStream))
                     using (var reader = new StreamReader(process.StandardError.BaseStream))
                     {
                     {

+ 2 - 2
MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs

@@ -139,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
                     UseShellExecute = false,
                     UseShellExecute = false,
 
 
                     // Must consume both stdout and stderr or deadlocks may occur
                     // Must consume both stdout and stderr or deadlocks may occur
-                    RedirectStandardOutput = true,
+                    //RedirectStandardOutput = true,
                     RedirectStandardError = true,
                     RedirectStandardError = true,
                     RedirectStandardInput = true,
                     RedirectStandardInput = true,
 
 
@@ -174,7 +174,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
             cancellationToken.Register(Stop);
             cancellationToken.Register(Stop);
 
 
             // MUST read both stdout and stderr asynchronously or a deadlock may occurr
             // MUST read both stdout and stderr asynchronously or a deadlock may occurr
-            process.BeginOutputReadLine();
+            //process.BeginOutputReadLine();
 
 
             onStarted();
             onStarted();