pull/702/head
Luke Pulverenti 9 years ago
parent d9dcd21c47
commit 25125377e5

@ -1677,7 +1677,7 @@ namespace MediaBrowser.Api.Playback
private void TryStreamCopy(StreamState state, VideoStreamRequest videoRequest)
{
if (state.VideoStream != null && CanStreamCopyVideo(videoRequest, state.VideoStream))
if (state.VideoStream != null && CanStreamCopyVideo(state))
{
state.OutputVideoCodec = "copy";
}
@ -1770,8 +1770,11 @@ namespace MediaBrowser.Api.Playback
state.MediaSource = mediaSource;
}
protected virtual bool CanStreamCopyVideo(VideoStreamRequest request, MediaStream videoStream)
protected virtual bool CanStreamCopyVideo(StreamState state)
{
var request = state.VideoRequest;
var videoStream = state.VideoStream;
if (videoStream.IsInterlaced)
{
return false;

@ -500,13 +500,20 @@ namespace MediaBrowser.Api.Playback.Hls
return ResultFactory.GetResult(playlistText, MimeTypes.GetMimeType("playlist.m3u8"), new Dictionary<string, string>());
}
private bool IsLiveStream(StreamState state)
{
var isLiveStream = (state.RunTimeTicks ?? 0) == 0;
return isLiveStream;
}
private string GetMasterPlaylistFileText(StreamState state, int totalBitrate)
{
var builder = new StringBuilder();
builder.AppendLine("#EXTM3U");
var isLiveStream = (state.RunTimeTicks ?? 0) == 0;
var isLiveStream = IsLiveStream(state);
var queryStringIndex = Request.RawUrl.IndexOf('?');
var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex);
@ -929,10 +936,16 @@ namespace MediaBrowser.Api.Playback.Hls
return isOutputVideo ? ".ts" : ".ts";
}
protected override bool CanStreamCopyVideo(VideoStreamRequest request, MediaStream videoStream)
protected override bool CanStreamCopyVideo(StreamState state)
{
return false;
//return base.CanStreamCopyVideo(request, videoStream);
var isLiveStream = IsLiveStream(state);
if (!isLiveStream)
{
return false;
}
return base.CanStreamCopyVideo(state);
}
}
}

@ -477,7 +477,7 @@ namespace MediaBrowser.WebDashboard.Api
var tags = files.Select(s =>
{
if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1)
if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1 && s.IndexOf("alameda", StringComparison.OrdinalIgnoreCase) == -1)
{
return string.Format("<script src=\"{0}\" async></script>", s);
}

Loading…
Cancel
Save