aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/BaseHlsService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Hls/BaseHlsService.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
index 1a190b75e..6e71e503f 100644
--- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
@@ -93,10 +93,12 @@ namespace MediaBrowser.Api.Playback.Hls
if (!state.VideoRequest.VideoBitRate.HasValue && (string.IsNullOrEmpty(state.VideoRequest.VideoCodec) || !string.Equals(state.VideoRequest.VideoCodec, "copy", StringComparison.OrdinalIgnoreCase)))
{
+ state.Dispose();
throw new ArgumentException("A video bitrate is required");
}
if (!state.Request.AudioBitRate.HasValue && (string.IsNullOrEmpty(state.Request.AudioCodec) || !string.Equals(state.Request.AudioCodec, "copy", StringComparison.OrdinalIgnoreCase)))
{
+ state.Dispose();
throw new ArgumentException("An audio bitrate is required");
}
@@ -107,7 +109,16 @@ namespace MediaBrowser.Api.Playback.Hls
if (!File.Exists(playlist))
{
isPlaylistNewlyCreated = true;
- await StartFfMpeg(state, playlist).ConfigureAwait(false);
+
+ try
+ {
+ await StartFfMpeg(state, playlist).ConfigureAwait(false);
+ }
+ catch
+ {
+ state.Dispose();
+ throw;
+ }
}
else
{