diff options
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/BaseMediaHandler.cs')
| -rw-r--r-- | MediaBrowser.Api/HttpHandlers/BaseMediaHandler.cs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/BaseMediaHandler.cs b/MediaBrowser.Api/HttpHandlers/BaseMediaHandler.cs index e87af76ea..7ad0ed8aa 100644 --- a/MediaBrowser.Api/HttpHandlers/BaseMediaHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/BaseMediaHandler.cs @@ -38,7 +38,7 @@ namespace MediaBrowser.Api.HttpHandlers }
}
- private TBaseItemType _LibraryItem;
+ private TBaseItemType _libraryItem;
/// <summary>
/// Gets the library item that will be played, if any
/// </summary>
@@ -46,17 +46,17 @@ namespace MediaBrowser.Api.HttpHandlers {
get
{
- if (_LibraryItem == null)
+ if (_libraryItem == null)
{
string id = QueryString["id"];
if (!string.IsNullOrEmpty(id))
{
- _LibraryItem = Kernel.Instance.GetItemById(Guid.Parse(id)) as TBaseItemType;
+ _libraryItem = Kernel.Instance.GetItemById(Guid.Parse(id)) as TBaseItemType;
}
}
- return _LibraryItem;
+ return _libraryItem;
}
}
@@ -92,7 +92,7 @@ namespace MediaBrowser.Api.HttpHandlers public override Task<string> GetContentType()
{
- return Task.FromResult<string>(MimeTypes.GetMimeType("." + GetConversionOutputFormat()));
+ return Task.FromResult(MimeTypes.GetMimeType("." + GetConversionOutputFormat()));
}
public override bool ShouldCompressResponse(string contentType)
@@ -106,12 +106,10 @@ namespace MediaBrowser.Api.HttpHandlers if (!RequiresConversion())
{
- return new StaticFileHandler() { Path = LibraryItem.Path }.ProcessRequest(ctx);
- }
- else
- {
- return base.ProcessRequest(ctx);
+ return new StaticFileHandler { Path = LibraryItem.Path }.ProcessRequest(ctx);
}
+
+ return base.ProcessRequest(ctx);
}
protected abstract string GetCommandLineArguments();
@@ -149,7 +147,7 @@ namespace MediaBrowser.Api.HttpHandlers protected async override Task WriteResponseToOutputStream(Stream stream)
{
- ProcessStartInfo startInfo = new ProcessStartInfo();
+ var startInfo = new ProcessStartInfo{};
startInfo.CreateNoWindow = true;
@@ -165,7 +163,7 @@ namespace MediaBrowser.Api.HttpHandlers Logger.LogInfo(startInfo.FileName + " " + startInfo.Arguments);
- Process process = new Process();
+ var process = new Process{};
process.StartInfo = startInfo;
// FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
@@ -173,7 +171,7 @@ namespace MediaBrowser.Api.HttpHandlers process.EnableRaisingEvents = true;
- process.Exited += process_Exited;
+ process.Exited += ProcessExited;
try
{
@@ -203,14 +201,14 @@ namespace MediaBrowser.Api.HttpHandlers }
}
- void process_Exited(object sender, EventArgs e)
+ void ProcessExited(object sender, EventArgs e)
{
if (LogFileStream != null)
{
LogFileStream.Dispose();
}
- Process process = sender as Process;
+ var process = sender as Process;
Logger.LogInfo("FFMpeg exited with code " + process.ExitCode);
|
