@ -199,9 +199,9 @@ namespace MediaBrowser.Api.Playback.Hls
Logger . Debug ( "Starting transcoding because requestedIndex={0} and currentTranscodingIndex={1}" , requestedIndex , currentTranscodingIndex ) ;
Logger . Debug ( "Starting transcoding because requestedIndex={0} and currentTranscodingIndex={1}" , requestedIndex , currentTranscodingIndex ) ;
startTranscoding = true ;
startTranscoding = true ;
}
}
else if ( ( requestedIndex - currentTranscodingIndex . Value ) > segmentGapRequiringTranscodingChange )
else if ( requestedIndex - currentTranscodingIndex . Value > segmentGapRequiringTranscodingChange )
{
{
Logger . Debug ( "Starting transcoding because segmentGap is {0} and max allowed gap is {1}. requestedIndex={2}" , ( requestedIndex - currentTranscodingIndex . Value ) , segmentGapRequiringTranscodingChange , requestedIndex ) ;
Logger . Debug ( "Starting transcoding because segmentGap is {0} and max allowed gap is {1}. requestedIndex={2}" , requestedIndex - currentTranscodingIndex . Value , segmentGapRequiringTranscodingChange , requestedIndex ) ;
startTranscoding = true ;
startTranscoding = true ;
}
}
if ( startTranscoding )
if ( startTranscoding )
@ -524,7 +524,7 @@ namespace MediaBrowser.Api.Playback.Hls
. ToList ( ) ;
. ToList ( ) ;
var subtitleGroup = subtitleStreams . Count > 0 & &
var subtitleGroup = subtitleStreams . Count > 0 & &
( request is GetMasterHlsVideoPlaylist ) & &
request is GetMasterHlsVideoPlaylist & &
( ( GetMasterHlsVideoPlaylist ) request ) . SubtitleMethod = = SubtitleDeliveryMethod . Hls ?
( ( GetMasterHlsVideoPlaylist ) request ) . SubtitleMethod = = SubtitleDeliveryMethod . Hls ?
"subs" :
"subs" :
null ;
null ;
@ -544,12 +544,12 @@ namespace MediaBrowser.Api.Playback.Hls
var variation = GetBitrateVariation ( totalBitrate ) ;
var variation = GetBitrateVariation ( totalBitrate ) ;
var newBitrate = totalBitrate - variation ;
var newBitrate = totalBitrate - variation ;
var variantUrl = ReplaceBitrate ( playlistUrl , requestedVideoBitrate , ( requestedVideoBitrate - variation ) ) ;
var variantUrl = ReplaceBitrate ( playlistUrl , requestedVideoBitrate , requestedVideoBitrate - variation ) ;
AppendPlaylist ( builder , state , variantUrl , newBitrate , subtitleGroup ) ;
AppendPlaylist ( builder , state , variantUrl , newBitrate , subtitleGroup ) ;
variation * = 2 ;
variation * = 2 ;
newBitrate = totalBitrate - variation ;
newBitrate = totalBitrate - variation ;
variantUrl = ReplaceBitrate ( playlistUrl , requestedVideoBitrate , ( requestedVideoBitrate - variation ) ) ;
variantUrl = ReplaceBitrate ( playlistUrl , requestedVideoBitrate , requestedVideoBitrate - variation ) ;
AppendPlaylist ( builder , state , variantUrl , newBitrate , subtitleGroup ) ;
AppendPlaylist ( builder , state , variantUrl , newBitrate , subtitleGroup ) ;
}
}
@ -703,7 +703,7 @@ namespace MediaBrowser.Api.Playback.Hls
builder . AppendLine ( "#EXTM3U" ) ;
builder . AppendLine ( "#EXTM3U" ) ;
builder . AppendLine ( "#EXT-X-PLAYLIST-TYPE:VOD" ) ;
builder . AppendLine ( "#EXT-X-PLAYLIST-TYPE:VOD" ) ;
builder . AppendLine ( "#EXT-X-VERSION:3" ) ;
builder . AppendLine ( "#EXT-X-VERSION:3" ) ;
builder . AppendLine ( "#EXT-X-TARGETDURATION:" + Math . Ceiling ( ( segmentLengths . Length > 0 ? segmentLengths . Max ( ) : state . SegmentLength ) ) . ToString ( UsCulture ) ) ;
builder . AppendLine ( "#EXT-X-TARGETDURATION:" + Math . Ceiling ( segmentLengths . Length > 0 ? segmentLengths . Max ( ) : state . SegmentLength ) . ToString ( UsCulture ) ) ;
builder . AppendLine ( "#EXT-X-MEDIA-SEQUENCE:0" ) ;
builder . AppendLine ( "#EXT-X-MEDIA-SEQUENCE:0" ) ;
var queryStringIndex = Request . RawUrl . IndexOf ( '?' ) ;
var queryStringIndex = Request . RawUrl . IndexOf ( '?' ) ;