diff options
| author | Cody Robibero <cody@robibe.ro> | 2022-04-04 07:20:20 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2022-04-07 12:54:58 -0400 |
| commit | 1425ef3cb4fcb7272917c9cacbc8d1915cd245b7 (patch) | |
| tree | 78eb640c9fd50b7bc483d90d0f2120d846dd47fd | |
| parent | 9e380768dd1e93b78cfa2f205a6ae626776d4a78 (diff) | |
Merge pull request #7542 from 1337joe/make-recording-stop
Make recording stop at scheduled stop time
(cherry picked from commit 132c85e554db0c80dab6e66ad17c504641431d5b)
Signed-off-by: crobibero <cody@robibe.ro>
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 582e61d79..6e0559841 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV await RecordFromFile(mediaSource, mediaSource.Path, targetFile, onStarted, cancellationTokenSource.Token).ConfigureAwait(false); - _logger.LogInformation("Recording completed to file {0}", targetFile); + _logger.LogInformation("Recording completed to file {Path}", targetFile); } private async Task RecordFromFile(MediaSourceInfo mediaSource, string inputFile, string targetFile, Action onStarted, CancellationToken cancellationToken) @@ -115,7 +115,10 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback _ = StartStreamingLog(_process.StandardError.BaseStream, _logFileStream); - _logger.LogInformation("ffmpeg recording process started for {0}", _targetPath); + _logger.LogInformation("ffmpeg recording process started for {Path}", _targetPath); + + // Block until ffmpeg exits + await _taskCompletionSource.Task.ConfigureAwait(false); } private string GetCommandLineArgs(MediaSourceInfo mediaSource, string inputTempFile, string targetFile) |
