|
|
|
@ -482,7 +482,9 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var nextSegmentPath = GetSegmentPath(state, playlistPath, segmentIndex + 1);
|
|
|
|
|
while (!cancellationToken.IsCancellationRequested && transcodingJob != null && !transcodingJob.HasExited)
|
|
|
|
|
if (transcodingJob != null)
|
|
|
|
|
{
|
|
|
|
|
while (!cancellationToken.IsCancellationRequested && !transcodingJob.HasExited)
|
|
|
|
|
{
|
|
|
|
|
// To be considered ready, the segment file has to exist AND
|
|
|
|
|
// either the transcoding job should be done or next segment should also exist
|
|
|
|
@ -514,6 +516,12 @@ namespace MediaBrowser.Api.Playback.Hls
|
|
|
|
|
{
|
|
|
|
|
Logger.LogDebug("serving {0} as it's on disk and transcoding stopped", segmentPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Logger.LogWarning("cannot serve {0} as it doesn't exist and no transcode is running", segmentPath);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|