diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-01-20 23:48:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-20 23:48:23 -0500 |
| commit | 3518400b228a7fa91c5f372d5889bf3f83f55776 (patch) | |
| tree | b9622932f5fdc479ae52143e7ddd8bdf45c2b0d5 | |
| parent | adf037c44c798b366b90e047bc62c40b72a883f2 (diff) | |
| parent | 920c39454c05e979eabe81877269cd4517a03ccf (diff) | |
Merge branch 'master' into release-10.1.0
| -rw-r--r-- | CONTRIBUTORS.md | 3 | ||||
| -rw-r--r-- | MediaBrowser.Api/Subtitles/SubtitleService.cs | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 17df49f30..8ae6c81a8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -14,7 +14,8 @@ - [grafixeyehero](https://github.com/grafixeyehero) - [cvium](https://github.com/cvium) - [wtayl0r](https://github.com/wtayl0r) - + - [TtheCreator](https://github.com/Tthecreator) + # Emby Contributors - [LukePulverenti](https://github.com/LukePulverenti) diff --git a/MediaBrowser.Api/Subtitles/SubtitleService.cs b/MediaBrowser.Api/Subtitles/SubtitleService.cs index 0552fbbd8..08aa540a5 100644 --- a/MediaBrowser.Api/Subtitles/SubtitleService.cs +++ b/MediaBrowser.Api/Subtitles/SubtitleService.cs @@ -156,14 +156,19 @@ namespace MediaBrowser.Api.Subtitles throw new ArgumentException("HLS Subtitles are not supported for this media."); } + var segmentLengthTicks = TimeSpan.FromSeconds(request.SegmentLength).Ticks; + if (segmentLengthTicks <= 0) + { + throw new ArgumentException("segmentLength was not given, or it was given incorrectly. (It should be bigger than 0)"); + } + builder.AppendLine("#EXTM3U"); builder.AppendLine("#EXT-X-TARGETDURATION:" + request.SegmentLength.ToString(CultureInfo.InvariantCulture)); builder.AppendLine("#EXT-X-VERSION:3"); builder.AppendLine("#EXT-X-MEDIA-SEQUENCE:0"); builder.AppendLine("#EXT-X-PLAYLIST-TYPE:VOD"); - long positionTicks = 0; - var segmentLengthTicks = TimeSpan.FromSeconds(request.SegmentLength).Ticks; + long positionTicks = 0; var accessToken = _authContext.GetAuthorizationInfo(Request).Token; |
