fix dlna flag values

This commit is contained in:
Luke Pulverenti 2014-04-23 11:35:31 -04:00
parent 6a435d62f5
commit 73b771f9c5
2 changed files with 14 additions and 2 deletions

View File

@ -39,8 +39,8 @@ namespace MediaBrowser.Model.Dlna
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK; //flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
} }
var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}000000000000000000000000", var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
Enum.Format(typeof(DlnaFlags), flagValue, "x")); FlagsToString(flagValue));
var mediaProfile = _profile.GetAudioMediaProfile(container, audioCodec); var mediaProfile = _profile.GetAudioMediaProfile(container, audioCodec);
@ -56,6 +56,12 @@ namespace MediaBrowser.Model.Dlna
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';'); 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, public string BuildVideoHeader(string container,
string videoCodec, string videoCodec,
string audioCodec, string audioCodec,

View File

@ -9,6 +9,12 @@ namespace MediaBrowser.Model.Dlna
private readonly List<string> _fields; private readonly List<string> _fields;
private readonly bool _all; private readonly bool _all;
public Filter()
: this("*")
{
}
public Filter(string filter) public Filter(string filter)
{ {
_all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase); _all = string.Equals(filter, "*", StringComparison.OrdinalIgnoreCase);