update naming project

pull/702/head
Luke Pulverenti 10 years ago
parent 0a62c66685
commit 1e7b3af9c2

@ -11,6 +11,7 @@ namespace MediaBrowser.Dlna.Profiles
Name = "WDTV Live";
TimelineOffsetSeconds = 5;
IgnoreTranscodeByteRangeRequests = true;
Identification = new DeviceIdentification
{

@ -118,10 +118,7 @@ namespace MediaBrowser.Dlna.Ssdp
public void Start()
{
_socket = CreateMulticastSocket();
_logger.Info("SSDP service started");
Receive();
RestartSocketListener();
ReloadAliveNotifier();
}
@ -289,6 +286,56 @@ namespace MediaBrowser.Dlna.Ssdp
}
}
private void RestartSocketListener()
{
if (_isDisposed)
{
StopSocketRetryTimer();
return;
}
try
{
_socket = CreateMulticastSocket();
_logger.Info("MultiCast socket created");
StopSocketRetryTimer();
Receive();
}
catch (Exception ex)
{
_logger.ErrorException("Error creating MultiCast socket", ex);
//StartSocketRetryTimer();
}
}
private Timer _socketRetryTimer;
private readonly object _socketRetryLock = new object();
private void StartSocketRetryTimer()
{
lock (_socketRetryLock)
{
if (_socketRetryTimer == null)
{
_socketRetryTimer = new Timer(s => RestartSocketListener(), null, TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30));
}
}
}
private void StopSocketRetryTimer()
{
lock (_socketRetryLock)
{
if (_socketRetryTimer != null)
{
_socketRetryTimer.Dispose();
_socketRetryTimer = null;
}
}
}
private void Receive()
{
try
@ -297,10 +344,15 @@ namespace MediaBrowser.Dlna.Ssdp
EndPoint endpoint = new IPEndPoint(IPAddress.Any, SSDPPort);
_socket.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref endpoint, ReceiveCallback, buffer);
_socket.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref endpoint, ReceiveCallback,
buffer);
}
catch (ObjectDisposedException)
{
if (!_isDisposed)
{
//StartSocketRetryTimer();
}
}
catch (Exception ex)
{
@ -348,6 +400,13 @@ namespace MediaBrowser.Dlna.Ssdp
OnMessageReceived(args);
}
catch (ObjectDisposedException)
{
if (!_isDisposed)
{
//StartSocketRetryTimer();
}
}
catch (Exception ex)
{
_logger.ErrorException("Failed to read SSDP message", ex);

@ -38,7 +38,7 @@ namespace MediaBrowser.MediaEncoding.Probing
var internalStreams = data.streams ?? new MediaStreamInfo[] { };
info.MediaStreams = internalStreams.Select(s => GetMediaStream(s, data.format))
info.MediaStreams = internalStreams.Select(s => GetMediaStream(isAudio, s, data.format))
.Where(i => i != null)
.ToList();
@ -94,7 +94,7 @@ namespace MediaBrowser.MediaEncoding.Probing
/// <param name="streamInfo">The stream info.</param>
/// <param name="formatInfo">The format info.</param>
/// <returns>MediaStream.</returns>
private MediaStream GetMediaStream(MediaStreamInfo streamInfo, MediaFormatInfo formatInfo)
private MediaStream GetMediaStream(bool isAudio, MediaStreamInfo streamInfo, MediaFormatInfo formatInfo)
{
var stream = new MediaStream
{
@ -129,7 +129,7 @@ namespace MediaBrowser.MediaEncoding.Probing
}
else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase))
{
stream.Type = (streamInfo.codec_name ?? string.Empty).IndexOf("mjpeg", StringComparison.OrdinalIgnoreCase) != -1
stream.Type = isAudio
? MediaStreamType.EmbeddedImage
: MediaStreamType.Video;

@ -76,6 +76,7 @@ namespace MediaBrowser.Model.Dlna
public bool RequiresPlainFolders { get; set; }
public bool EnableMSMediaReceiverRegistrar { get; set; }
public bool IgnoreTranscodeByteRangeRequests { get; set; }
public XmlAttribute[] XmlRootAttributes { get; set; }

@ -52,7 +52,7 @@ namespace MediaBrowser.Providers.MediaInfo
return ItemUpdateType.MetadataImport;
}
private const string SchemaVersion = "2";
private const string SchemaVersion = "3";
private async Task<Model.MediaInfo.MediaInfo> GetMediaInfo(BaseItem item, CancellationToken cancellationToken)
{

@ -17,7 +17,6 @@ using MediaBrowser.Model.Querying;
using MoreLinq;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;

@ -48,8 +48,9 @@
<Reference Include="Interfaces.IO">
<HintPath>..\packages\Interfaces.IO.1.0.0.5\lib\portable-net45+sl4+wp71+win8+wpa81\Interfaces.IO.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Naming">
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.35\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
<Reference Include="MediaBrowser.Naming, Version=1.0.5607.1779, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.36\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
</Reference>
<Reference Include="Mono.Nat, Version=1.2.24.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Interfaces.IO" version="1.0.0.5" targetFramework="net45" />
<package id="MediaBrowser.Naming" version="1.0.0.35" targetFramework="net45" />
<package id="MediaBrowser.Naming" version="1.0.0.36" targetFramework="net45" />
<package id="Mono.Nat" version="1.2.24.0" targetFramework="net45" />
<package id="morelinq" version="1.1.0" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />

@ -1,4 +1,4 @@
using System.Reflection;
//[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5607.0")]
[assembly: AssemblyVersion("3.0.*")]
//[assembly: AssemblyVersion("3.0.5607.0")]

Loading…
Cancel
Save