Selaa lähdekoodia

await async functions

Bond-009 6 vuotta sitten
vanhempi
sitoutus
da2caa2902

+ 2 - 2
MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs

@@ -234,7 +234,7 @@ namespace MediaBrowser.Api.Playback.Hls
                         // If the playlist doesn't already exist, startup ffmpeg
                         try
                         {
-                            ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, p => false);
+                            await ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, p => false);
 
                             if (currentTranscodingIndex.HasValue)
                             {
@@ -258,7 +258,7 @@ namespace MediaBrowser.Api.Playback.Hls
                         job = ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType);
                         if (job.TranscodingThrottler != null)
                         {
-                            job.TranscodingThrottler.UnpauseTranscoding();
+                            await job.TranscodingThrottler.UnpauseTranscoding();
                         }
                     }
                 }

+ 2 - 2
MediaBrowser.Api/Playback/Hls/HlsSegmentService.cs

@@ -102,9 +102,9 @@ namespace MediaBrowser.Api.Playback.Hls
             return GetFileResult(file, file);
         }
 
-        public void Delete(StopEncodingProcess request)
+        public Task Delete(StopEncodingProcess request)
         {
-            ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, path => true);
+            return ApiEntryPoint.Instance.KillTranscodingJobs(request.DeviceId, request.PlaySessionId, path => true);
         }
 
         /// <summary>