From 6ac7675c15af7cf5ea2aaed6c9e329af7eb62c44 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 26 Mar 2014 15:21:29 -0400 Subject: add dlna service methods --- MediaBrowser.Controller/Dlna/IDlnaManager.cs | 6 ++++ .../MediaEncoding/MediaEncoderHelpers.cs | 32 ++++++++++------------ 2 files changed, 21 insertions(+), 17 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Dlna/IDlnaManager.cs b/MediaBrowser.Controller/Dlna/IDlnaManager.cs index dfed5e3108..eb4b65e143 100644 --- a/MediaBrowser.Controller/Dlna/IDlnaManager.cs +++ b/MediaBrowser.Controller/Dlna/IDlnaManager.cs @@ -23,6 +23,12 @@ namespace MediaBrowser.Controller.Dlna /// /// DeviceProfile. DeviceProfile GetDefaultProfile(); + + /// + /// Deletes the profile. + /// + /// The identifier. + void DeleteProfile(string id); /// /// Gets the profile. diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs index 1840331773..fd1f651017 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs @@ -154,7 +154,8 @@ namespace MediaBrowser.Controller.MediaEncoding Codec = streamInfo.codec_name, Profile = streamInfo.profile, Level = streamInfo.level, - Index = streamInfo.index + Index = streamInfo.index, + PixelFormat = streamInfo.pix_fmt }; if (streamInfo.tags != null) @@ -196,24 +197,21 @@ namespace MediaBrowser.Controller.MediaEncoding } // Get stream bitrate - if (stream.Type != MediaStreamType.Subtitle) - { - var bitrate = 0; + var bitrate = 0; - if (!string.IsNullOrEmpty(streamInfo.bit_rate)) - { - bitrate = int.Parse(streamInfo.bit_rate, UsCulture); - } - else if (formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate)) - { - // If the stream info doesn't have a bitrate get the value from the media format info - bitrate = int.Parse(formatInfo.bit_rate, UsCulture); - } + if (!string.IsNullOrEmpty(streamInfo.bit_rate)) + { + bitrate = int.Parse(streamInfo.bit_rate, UsCulture); + } + else if (formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate) && stream.Type == MediaStreamType.Video) + { + // If the stream info doesn't have a bitrate get the value from the media format info + bitrate = int.Parse(formatInfo.bit_rate, UsCulture); + } - if (bitrate > 0) - { - stream.BitRate = bitrate; - } + if (bitrate > 0) + { + stream.BitRate = bitrate; } if (streamInfo.disposition != null) -- cgit v1.2.3