Skip to content

Commit

Permalink
Release 1.4 Build 15258
Browse files Browse the repository at this point in the history
Fixes #4 : the ContentDirectory service only include one resource with the receiver's IP
  • Loading branch information
sebastienwarin committed Oct 5, 2015
1 parent c52fb93 commit b52dc1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
2 changes: 1 addition & 1 deletion SWYH/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.15154.0")] // MAJOR.minor.BuildDate.Release (Si Release impaire = BETA) || http://www.epochconverter.com/epoch/daynumbers.php
[assembly: AssemblyFileVersion("1.4.15278.0")] // MAJOR.minor.BuildDate.Release (Si Release impaire = BETA) || http://www.epochconverter.com/epoch/daynumbers.php
[assembly: GuidAttribute("2ecd245f-4268-48ee-b0f1-0706ead1ba42")]
37 changes: 13 additions & 24 deletions SWYH/UPnP/DvContentDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

namespace SWYH.UPnP
{
using OpenSource.UPnP;
using OpenSource.UPnP.AV.CdsMetadata;
using SWYH.Audio;
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Xml;
using OpenSource.UPnP;
using OpenSource.UPnP.AV.CdsMetadata;
using SWYH.Audio;

/// <summary>
/// Transparent DeviceSide UPnP Service
Expand Down Expand Up @@ -1299,27 +1299,16 @@ internal List<string> GetWasapiUris(AudioFormats.Format format)
//<upnp:genre>Indie</upnp:genre>
//<upnp:class>object.item.audioItem.musicTrack</upnp:class>
//</item>
StringBuilder ressources = new StringBuilder();
foreach (var item in this.GetUPnPService().ParentDevice.LocalIPEndPoints)
{
if (item.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork && !item.ToString().StartsWith("127.0.0.1"))
{
string uri = "http://" + item.ToString() + "/stream/" + resFileName;
//sb.Append("<res protocolInfo=\"" + protocolInfo + "\">" + HttpUtility.HtmlEncode(uri) + "</res>");
//sb.Append("<res bitsPerSample=\"" + bitsPerSample + "\" protocolInfo=\"" + protocolInfo + "\" nrAudioChannels=\"" + nrAudioChannels + "\" bitrate=\"" + bitrate + "\" sampleFrequency=\"" + sampleFrequency + "\">" + HttpUtility.HtmlEncode(uri) + "</res>");
ressources.Append("<res bitsPerSample=\"" + bitsPerSample + "\" protocolInfo=\"" + protocolInfo + "\" duration=\"" + duration + "\" nrAudioChannels=\"" + nrAudioChannels + "\" bitrate=\"" + bitrate + "\" sampleFrequency=\"" + sampleFrequency + "\">" + HttpUtility.HtmlEncode(uri) + "</res>");
}
}
string retVal =
"<item id=\"" + id + "\" parentID=\"" + parentID + "\" restricted=\"" + restricted + "\">" +
"<dc:title>" + HttpUtility.HtmlEncode(title) + "</dc:title>" +
ressources.ToString() +
"<upnp:artist>" + artist + "</upnp:artist>" +
"<upnp:album>" + album + "</upnp:album>" +
"<upnp:genre>" + genre + "</upnp:genre>" +
"<upnp:class>" + upnpClass + "</upnp:class>" +
"</item>";
return retVal;
return "<item id=\"" + id + "\" parentID=\"" + parentID + "\" restricted=\"" + restricted + "\">" +
"<dc:title>" + HttpUtility.HtmlEncode(title) + "</dc:title>" +
"<upnp:artist>" + artist + "</upnp:artist>" +
"<res bitsPerSample=\"" + bitsPerSample + "\" protocolInfo=\"" + protocolInfo + "\" duration=\"" + duration + "\" nrAudioChannels=\"" + nrAudioChannels + "\" bitrate=\"" + bitrate + "\" sampleFrequency=\"" + sampleFrequency + "\">" +
HttpUtility.HtmlEncode("http://" + this.GetReceiver().ToString() + "/stream/" + resFileName) +
"</res>" +
"<upnp:album>" + album + "</upnp:album>" +
"<upnp:genre>" + genre + "</upnp:genre>" +
"<upnp:class>" + upnpClass + "</upnp:class>" +
"</item>";
}

#region Not Implemented
Expand Down

0 comments on commit b52dc1d

Please sign in to comment.