aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-04-30 23:46:17 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-04-30 23:46:17 -0400
commit2d49ec4a53708f103c72f4d968ac9759ce1cdf9c (patch)
treef7718e311011f876188f0caf1b878dcf1d7f266c /MediaBrowser.Server.Startup.Common
parent780d5b914cc22bdf88477761e60c5de64b20504d (diff)
parent86919e84ee2bb89b8fc877c4e32379281c51877c (diff)
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs2
-rw-r--r--MediaBrowser.Server.Startup.Common/EntryPoints/KeepServerAwake.cs31
-rw-r--r--MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs4
-rw-r--r--MediaBrowser.Server.Startup.Common/INativeApp.cs2
4 files changed, 21 insertions, 18 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index 01575e71f..fd6dee0f6 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -515,7 +515,7 @@ namespace MediaBrowser.Server.Startup.Common
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);
RegisterSingleInstance(UserViewManager);
- var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager, ChannelManager, MediaSourceManager, UserViewManager);
+ var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager, ChannelManager, MediaSourceManager, UserViewManager, () => MediaEncoder);
RegisterSingleInstance<IContentDirectory>(contentDirectory);
var mediaRegistrar = new MediaReceiverRegistrar(LogManager.GetLogger("MediaReceiverRegistrar"), HttpClient, ServerConfigurationManager);
diff --git a/MediaBrowser.Server.Startup.Common/EntryPoints/KeepServerAwake.cs b/MediaBrowser.Server.Startup.Common/EntryPoints/KeepServerAwake.cs
index 20d4c6b2a..dbfd6f4e8 100644
--- a/MediaBrowser.Server.Startup.Common/EntryPoints/KeepServerAwake.cs
+++ b/MediaBrowser.Server.Startup.Common/EntryPoints/KeepServerAwake.cs
@@ -27,28 +27,27 @@ namespace MediaBrowser.Server.Startup.Common.EntryPoints
_timer = new PeriodicTimer(obj =>
{
var now = DateTime.UtcNow;
- if (_sessionManager.Sessions.Any(i => (now - i.LastActivityDate).TotalMinutes < 15))
+ var nativeApp = ((ApplicationHost)_appHost).NativeApp;
+
+ try
+ {
+ if (_sessionManager.Sessions.Any(i => (now - i.LastActivityDate).TotalMinutes < 15))
+ {
+ nativeApp.PreventSystemStandby();
+ }
+ else
+ {
+ nativeApp.AllowSystemStandby();
+ }
+ }
+ catch (Exception ex)
{
- KeepAlive();
+ _logger.ErrorException("Error resetting system standby timer", ex);
}
}, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
}
- private void KeepAlive()
- {
- var nativeApp = ((ApplicationHost)_appHost).NativeApp;
-
- try
- {
- nativeApp.PreventSystemStandby();
- }
- catch (Exception ex)
- {
- _logger.ErrorException("Error resetting system standby timer", ex);
- }
- }
-
public void Dispose()
{
if (_timer != null)
diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs
index 5ba5fb44a..0ae021407 100644
--- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs
+++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs
@@ -42,6 +42,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
catch
{
}
+ //_logger.Debug("ffmpeg decoder query result: {0}", output ?? string.Empty);
var found = new List<string>();
var required = new[]
@@ -78,6 +79,7 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
catch
{
}
+ //_logger.Debug("ffmpeg encoder query result: {0}", output ?? string.Empty);
var found = new List<string>();
var required = new[]
@@ -89,8 +91,8 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg
//"libvpx",
//"libvpx-vp9",
"aac",
- "ac3",
"libmp3lame",
+ "libopus",
//"libvorbis",
"srt"
};
diff --git a/MediaBrowser.Server.Startup.Common/INativeApp.cs b/MediaBrowser.Server.Startup.Common/INativeApp.cs
index c603a908e..c0758b47f 100644
--- a/MediaBrowser.Server.Startup.Common/INativeApp.cs
+++ b/MediaBrowser.Server.Startup.Common/INativeApp.cs
@@ -93,6 +93,8 @@ namespace MediaBrowser.Server.Startup.Common
/// </summary>
void PreventSystemStandby();
+ void AllowSystemStandby();
+
/// <summary>
/// Gets the power management.
/// </summary>