mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-02 23:06:31 +01:00
update ProcessManager
This commit is contained in:
9
MediaBrowser.Model/Dlna/PlaybackErrorCode.cs
Normal file
9
MediaBrowser.Model/Dlna/PlaybackErrorCode.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public enum PlaybackErrorCode
|
||||
{
|
||||
NotAllowed = 0,
|
||||
NoCompatibleStream = 1
|
||||
}
|
||||
}
|
||||
9
MediaBrowser.Model/Dlna/PlaybackException.cs
Normal file
9
MediaBrowser.Model/Dlna/PlaybackException.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class PlaybackException : Exception
|
||||
{
|
||||
public PlaybackErrorCode ErrorCode { get; set;}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
List<StreamInfo> streams = new List<StreamInfo>();
|
||||
foreach (MediaSourceInfo i in mediaSources)
|
||||
streams.Add(BuildAudioItem(i, options));
|
||||
{
|
||||
StreamInfo streamInfo = BuildAudioItem(i, options);
|
||||
if (streamInfo != null)
|
||||
{
|
||||
streams.Add(streamInfo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (StreamInfo stream in streams)
|
||||
{
|
||||
@@ -63,7 +69,13 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
List<StreamInfo> streams = new List<StreamInfo>();
|
||||
foreach (MediaSourceInfo i in mediaSources)
|
||||
streams.Add(BuildVideoItem(i, options));
|
||||
{
|
||||
StreamInfo streamInfo = BuildVideoItem(i, options);
|
||||
if (streamInfo != null)
|
||||
{
|
||||
streams.Add(streamInfo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (StreamInfo stream in streams)
|
||||
{
|
||||
@@ -97,7 +109,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
return stream;
|
||||
}
|
||||
return null;
|
||||
|
||||
PlaybackException error = new PlaybackException();
|
||||
error.ErrorCode = PlaybackErrorCode.NoCompatibleStream;
|
||||
throw error;
|
||||
}
|
||||
|
||||
private StreamInfo BuildAudioItem(MediaSourceInfo item, AudioOptions options)
|
||||
@@ -186,6 +201,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (transcodingProfile != null)
|
||||
{
|
||||
if (!item.SupportsTranscoding)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
playlistItem.PlayMethod = PlayMethod.Transcode;
|
||||
playlistItem.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo;
|
||||
playlistItem.EstimateContentLength = transcodingProfile.EstimateContentLength;
|
||||
@@ -290,6 +310,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (transcodingProfile != null)
|
||||
{
|
||||
if (!item.SupportsTranscoding)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (subtitleStream != null)
|
||||
{
|
||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile, options.Context);
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace MediaBrowser.Model.Dto
|
||||
|
||||
public long? RunTimeTicks { get; set; }
|
||||
public bool ReadAtNativeFramerate { get; set; }
|
||||
public bool SupportsTranscoding { get; set; }
|
||||
|
||||
public VideoType? VideoType { get; set; }
|
||||
|
||||
@@ -45,6 +46,7 @@ namespace MediaBrowser.Model.Dto
|
||||
MediaStreams = new List<MediaStream>();
|
||||
RequiredHttpHeaders = new Dictionary<string, string>();
|
||||
PlayableStreamFileNames = new List<string>();
|
||||
SupportsTranscoding = true;
|
||||
}
|
||||
|
||||
public int? DefaultAudioStreamIndex { get; set; }
|
||||
|
||||
@@ -125,6 +125,8 @@
|
||||
<Compile Include="Devices\DeviceInfo.cs" />
|
||||
<Compile Include="Devices\DevicesOptions.cs" />
|
||||
<Compile Include="Dlna\EncodingContext.cs" />
|
||||
<Compile Include="Dlna\PlaybackErrorCode.cs" />
|
||||
<Compile Include="Dlna\PlaybackException.cs" />
|
||||
<Compile Include="Dlna\Profiles\DefaultProfile.cs" />
|
||||
<Compile Include="Dlna\ResolutionConfiguration.cs" />
|
||||
<Compile Include="Dlna\ResolutionNormalizer.cs" />
|
||||
|
||||
Reference in New Issue
Block a user