improve direct play to transcoding fallback
This commit is contained in:
parent
06394d1a9f
commit
8d1ca8ca27
|
@ -296,8 +296,8 @@
|
|||
<Project>{4f26d5d8-a7b0-42b3-ba42-7cb7d245934e}</Project>
|
||||
<Name>SocketHttpListener.Portable</Name>
|
||||
</ProjectReference>
|
||||
<Reference Include="Emby.XmlTv, Version=1.0.6251.29080, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Emby.XmlTv.1.0.7\lib\portable-net45+win8\Emby.XmlTv.dll</HintPath>
|
||||
<Reference Include="Emby.XmlTv, Version=1.0.6299.28292, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Emby.XmlTv.1.0.8\lib\portable-net45+win8\Emby.XmlTv.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.Naming, Version=1.0.6279.25941, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
|
|
@ -268,12 +268,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
|||
var results = reader.GetChannels();
|
||||
|
||||
// Should this method be async?
|
||||
return results.Select(c => new ChannelInfo()
|
||||
return results.Select(c => new ChannelInfo
|
||||
{
|
||||
Id = c.Id,
|
||||
Name = c.DisplayName,
|
||||
ImageUrl = c.Icon != null && !String.IsNullOrEmpty(c.Icon.Source) ? c.Icon.Source : null,
|
||||
Number = c.Id
|
||||
Number = string.IsNullOrWhiteSpace(c.Number) ? c.Id : c.Number
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Emby.XmlTv" version="1.0.7" targetFramework="portable45-net45+win8" />
|
||||
<package id="Emby.XmlTv" version="1.0.8" targetFramework="portable45-net45+win8" />
|
||||
<package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" />
|
||||
<package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" />
|
||||
<package id="SQLitePCLRaw.core" version="1.1.2" targetFramework="portable45-net45+win8" />
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace MediaBrowser.Api.Playback
|
|||
|
||||
SetDeviceSpecificData(item, result.MediaSource, profile, authInfo, request.MaxStreamingBitrate,
|
||||
request.StartTimeTicks ?? 0, result.MediaSource.Id, request.AudioStreamIndex,
|
||||
request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, true, true, true, true);
|
||||
request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, true, true, true, true, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -169,7 +169,7 @@ namespace MediaBrowser.Api.Playback
|
|||
{
|
||||
var mediaSourceId = request.MediaSourceId;
|
||||
|
||||
SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, request.EnableTranscoding);
|
||||
SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy);
|
||||
}
|
||||
|
||||
return info;
|
||||
|
@ -255,13 +255,15 @@ namespace MediaBrowser.Api.Playback
|
|||
bool enableDirectPlay,
|
||||
bool forceDirectPlayRemoteMediaSource,
|
||||
bool enableDirectStream,
|
||||
bool enableTranscoding)
|
||||
bool enableTranscoding,
|
||||
bool allowVideoStreamCopy,
|
||||
bool allowAudioStreamCopy)
|
||||
{
|
||||
var item = _libraryManager.GetItemById(itemId);
|
||||
|
||||
foreach (var mediaSource in result.MediaSources)
|
||||
{
|
||||
SetDeviceSpecificData(item, mediaSource, profile, auth, maxBitrate, startTimeTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, result.PlaySessionId, userId, enableDirectPlay, forceDirectPlayRemoteMediaSource, enableDirectStream, enableTranscoding);
|
||||
SetDeviceSpecificData(item, mediaSource, profile, auth, maxBitrate, startTimeTicks, mediaSourceId, audioStreamIndex, subtitleStreamIndex, maxAudioChannels, result.PlaySessionId, userId, enableDirectPlay, forceDirectPlayRemoteMediaSource, enableDirectStream, enableTranscoding, allowVideoStreamCopy, allowAudioStreamCopy);
|
||||
}
|
||||
|
||||
SortMediaSources(result, maxBitrate);
|
||||
|
@ -282,7 +284,9 @@ namespace MediaBrowser.Api.Playback
|
|||
bool enableDirectPlay,
|
||||
bool forceDirectPlayRemoteMediaSource,
|
||||
bool enableDirectStream,
|
||||
bool enableTranscoding)
|
||||
bool enableTranscoding,
|
||||
bool allowVideoStreamCopy,
|
||||
bool allowAudioStreamCopy)
|
||||
{
|
||||
var streamBuilder = new StreamBuilder(_mediaEncoder, Logger);
|
||||
|
||||
|
@ -418,6 +422,15 @@ namespace MediaBrowser.Api.Playback
|
|||
{
|
||||
streamInfo.StartPositionTicks = startTimeTicks;
|
||||
mediaSource.TranscodingUrl = streamInfo.ToUrl("-", auth.Token).TrimStart('-');
|
||||
|
||||
if (!allowVideoStreamCopy)
|
||||
{
|
||||
mediaSource.TranscodingUrl += "&allowVideoStreamCopy=false";
|
||||
}
|
||||
if (!allowAudioStreamCopy)
|
||||
{
|
||||
mediaSource.TranscodingUrl += "&allowAudioStreamCopy=false";
|
||||
}
|
||||
mediaSource.TranscodingContainer = streamInfo.Container;
|
||||
mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol;
|
||||
}
|
||||
|
|
|
@ -188,6 +188,14 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
{
|
||||
return null;
|
||||
}
|
||||
if (string.Equals(container, "ogm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (string.Equals(container, "divx", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Seeing reported failures here, not sure yet if this is related to specfying input format
|
||||
if (string.Equals(container, "m4v", StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -750,6 +758,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
|
||||
var request = state.BaseRequest;
|
||||
|
||||
if (!request.AllowVideoStreamCopy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (videoStream.IsInterlaced)
|
||||
{
|
||||
if (request.DeInterlace)
|
||||
|
@ -895,6 +908,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
|
||||
var request = state.BaseRequest;
|
||||
|
||||
if (!request.AllowAudioStreamCopy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Source and target codecs must match
|
||||
if (string.IsNullOrEmpty(audioStream.Codec) || !supportedAudioCodecs.Contains(audioStream.Codec, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
|
|
|
@ -72,6 +72,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
[ApiMember(Name = "EnableAutoStreamCopy", Description = "Whether or not to allow automatic stream copy if requested values match the original source. Defaults to true.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
|
||||
public bool EnableAutoStreamCopy { get; set; }
|
||||
|
||||
public bool AllowVideoStreamCopy { get; set; }
|
||||
public bool AllowAudioStreamCopy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio sample rate.
|
||||
/// </summary>
|
||||
|
@ -218,6 +221,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
public BaseEncodingJobOptions()
|
||||
{
|
||||
EnableAutoStreamCopy = true;
|
||||
AllowVideoStreamCopy = true;
|
||||
AllowAudioStreamCopy = true;
|
||||
Context = EncodingContext.Streaming;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,8 @@ namespace MediaBrowser.Model.MediaInfo
|
|||
public bool EnableDirectStream { get; set; }
|
||||
public bool EnableTranscoding { get; set; }
|
||||
public bool ForceDirectPlayRemoteMediaSource { get; set; }
|
||||
public bool AllowVideoStreamCopy { get; set; }
|
||||
public bool AllowAudioStreamCopy { get; set; }
|
||||
|
||||
public PlaybackInfoRequest()
|
||||
{
|
||||
|
@ -35,6 +37,8 @@ namespace MediaBrowser.Model.MediaInfo
|
|||
EnableDirectPlay = true;
|
||||
EnableDirectStream = true;
|
||||
EnableTranscoding = true;
|
||||
AllowVideoStreamCopy = true;
|
||||
AllowAudioStreamCopy = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user