diff options
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Api/Subtitles/SubtitleService.cs | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 96dc4ab4c..8d4b0cb3d 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -167,7 +167,7 @@ namespace MediaBrowser.Api.Playback public DeviceProfile DeviceProfile { get; set; } public TranscodingJob TranscodingJob; - public void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate) + public override void ReportTranscodingProgress(TimeSpan? transcodingPosition, float framerate, double? percentComplete, long bytesTranscoded, int? bitRate) { ApiEntryPoint.Instance.ReportTranscodingProgress(TranscodingJob, this, transcodingPosition, framerate, percentComplete, bytesTranscoded, bitRate); } 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; |
