From 73b771f9c5ae195869aee1e8ab72c534af976cfb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 23 Apr 2014 11:35:31 -0400 Subject: [PATCH] fix dlna flag values --- MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs | 10 ++++++++-- MediaBrowser.Model/Dlna/Filter.cs | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs index bd98704a9..351eca5be 100644 --- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs +++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs @@ -39,8 +39,8 @@ namespace MediaBrowser.Model.Dlna //flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK; } - var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}000000000000000000000000", - Enum.Format(typeof(DlnaFlags), flagValue, "x")); + var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}", + FlagsToString(flagValue)); var mediaProfile = _profile.GetAudioMediaProfile(container, audioCodec); @@ -56,6 +56,12 @@ namespace MediaBrowser.Model.Dlna return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';'); } + private static string FlagsToString(DlnaFlags flags) + { + //return Enum.Format(typeof(DlnaFlags), flags, "x"); + return string.Format("{0:X8}{1:D24}", (ulong)flags, 0); + } + public string BuildVideoHeader(string container, string videoCodec, string audioCodec, diff --git a/MediaBrowser.Model/Dlna/Filter.cs b/MediaBrowser.Model/Dlna/Filter.cs index 6655e84c2..c8940734b 100644 --- a/MediaBrowser.Model/Dlna/Filter.cs +++ b/MediaBrowser.Model/Dlna/Filter.cs @@ -9,6 +9,12 @@ namespace MediaBrowser.Model.Dlna private readonly List _fields; private readonly bool _all; + public Filter() + : this("*") + { + + } + public Filter(string filter) { _all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase);