make api project portable

This commit is contained in:
Luke Pulverenti
2016-10-31 23:07:45 -04:00
parent b28857feea
commit 13d8110ce2
35 changed files with 326 additions and 255 deletions

View File

@@ -356,7 +356,8 @@ namespace MediaBrowser.Api.Playback.Hls
{
Logger.ErrorException("Error deleting partial stream file(s) {0}", ex, file.FullName);
Thread.Sleep(100);
var task = Task.Delay(100);
Task.WaitAll(task);
DeleteFile(file, retryCount + 1);
}
catch (Exception ex)
@@ -378,7 +379,7 @@ namespace MediaBrowser.Api.Playback.Hls
.OrderByDescending(fileSystem.GetLastWriteTimeUtc)
.FirstOrDefault();
}
catch (DirectoryNotFoundException)
catch (IOException)
{
return null;
}
@@ -881,7 +882,7 @@ namespace MediaBrowser.Api.Playback.Hls
if (state.IsOutputVideo && !EnableCopyTs(state) && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) && (state.Request.StartTimeTicks ?? 0) > 0)
{
timestampOffsetParam = " -output_ts_offset " + MediaEncoder.GetTimeParameter(state.Request.StartTimeTicks ?? 0).ToString(CultureInfo.InvariantCulture);
timestampOffsetParam = " -output_ts_offset " + MediaEncoder.GetTimeParameter(state.Request.StartTimeTicks ?? 0);
}
var mapArgs = state.IsOutputVideo ? GetMapArgs(state) : string.Empty;