mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-16 20:50:48 +01:00
Merge pull request #1904 from JustAMan/hls-move-2
Switch ffmpeg to hls muxer (from segment) to fix premature stop on non-patched ffmpeg
(cherry picked from commit a460814182)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua Boniface
parent
1fad64cd59
commit
7a592a0f15
@@ -289,17 +289,22 @@ namespace MediaBrowser.Api.Playback
|
||||
throw;
|
||||
}
|
||||
|
||||
Logger.LogDebug("Launched ffmpeg process");
|
||||
state.TranscodingJob = transcodingJob;
|
||||
|
||||
// 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(state, process.StandardError.BaseStream, logStream);
|
||||
|
||||
// Wait for the file to exist before proceeeding
|
||||
while (!File.Exists(state.WaitForPath ?? outputPath) && !transcodingJob.HasExited)
|
||||
var ffmpegTargetFile = state.WaitForPath ?? outputPath;
|
||||
Logger.LogDebug("Waiting for the creation of {0}", ffmpegTargetFile);
|
||||
while (!File.Exists(ffmpegTargetFile) && !transcodingJob.HasExited)
|
||||
{
|
||||
await Task.Delay(100, cancellationTokenSource.Token).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
Logger.LogDebug("File {0} created or transcoding has finished", ffmpegTargetFile);
|
||||
|
||||
if (state.IsInputVideo && transcodingJob.Type == TranscodingJobType.Progressive && !transcodingJob.HasExited)
|
||||
{
|
||||
await Task.Delay(1000, cancellationTokenSource.Token).ConfigureAwait(false);
|
||||
@@ -314,6 +319,7 @@ namespace MediaBrowser.Api.Playback
|
||||
{
|
||||
StartThrottler(state, transcodingJob);
|
||||
}
|
||||
Logger.LogDebug("StartFfMpeg() finished successfully");
|
||||
|
||||
return transcodingJob;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user