|
|
@ -173,11 +173,14 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await ApiEntryPoint.Instance.TranscodingStartLock.WaitAsync(cancellationTokenSource.Token).ConfigureAwait(false);
|
|
|
|
await ApiEntryPoint.Instance.TranscodingStartLock.WaitAsync(cancellationTokenSource.Token).ConfigureAwait(false);
|
|
|
|
|
|
|
|
var released = false;
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (FileSystem.FileExists(segmentPath))
|
|
|
|
if (FileSystem.FileExists(segmentPath))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
job = ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType);
|
|
|
|
job = ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType);
|
|
|
|
|
|
|
|
ApiEntryPoint.Instance.TranscodingStartLock.Release();
|
|
|
|
|
|
|
|
released = true;
|
|
|
|
return await GetSegmentResult(state, playlistPath, segmentPath, requestedIndex, job, cancellationToken).ConfigureAwait(false);
|
|
|
|
return await GetSegmentResult(state, playlistPath, segmentPath, requestedIndex, job, cancellationToken).ConfigureAwait(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -237,9 +240,12 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
finally
|
|
|
|
finally
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!released)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ApiEntryPoint.Instance.TranscodingStartLock.Release();
|
|
|
|
ApiEntryPoint.Instance.TranscodingStartLock.Release();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Logger.Info("waiting for {0}", segmentPath);
|
|
|
|
//Logger.Info("waiting for {0}", segmentPath);
|
|
|
|
//while (!File.Exists(segmentPath))
|
|
|
|
//while (!File.Exists(segmentPath))
|
|
|
|