diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs
index 8bdf597a14..9f29b2db1a 100644
--- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs
+++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs
@@ -431,6 +431,22 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
cancellationToken.ThrowIfCancellationRequested();
+ if (result.streams != null)
+ {
+ // Normalize aspect ratio if invalid
+ foreach (var stream in result.streams)
+ {
+ if (string.Equals(stream.display_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.display_aspect_ratio = string.Empty;
+ }
+ if (string.Equals(stream.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.sample_aspect_ratio = string.Empty;
+ }
+ }
+ }
+
if (extractChapters && !string.IsNullOrEmpty(standardError))
{
AddChapters(result, standardError);
diff --git a/MediaBrowser.ServerApplication/App.xaml.cs b/MediaBrowser.ServerApplication/App.xaml.cs
index f446b4dc4b..3c1524eec4 100644
--- a/MediaBrowser.ServerApplication/App.xaml.cs
+++ b/MediaBrowser.ServerApplication/App.xaml.cs
@@ -24,12 +24,27 @@ namespace MediaBrowser.ServerApplication
///
public partial class App : Application
{
+ ///
+ /// The single instance mutex
+ ///
+ private static Mutex _singleInstanceMutex;
+
///
/// Defines the entry point of the application.
///
[STAThread]
public static void Main()
{
+ bool createdNew;
+
+ _singleInstanceMutex = new Mutex(true, @"Local\" + typeof(App).Assembly.GetName().Name, out createdNew);
+
+ if (!createdNew)
+ {
+ _singleInstanceMutex = null;
+ return;
+ }
+
// Look for the existence of an update archive
var appPaths = new ServerApplicationPaths();
var updateArchive = Path.Combine(appPaths.TempUpdatePath, Constants.MbServerPkgName + ".zip");
@@ -66,11 +81,6 @@ namespace MediaBrowser.ServerApplication
}
}
- ///
- /// The single instance mutex
- ///
- private Mutex SingleInstanceMutex;
-
///
/// Gets or sets the logger.
///
@@ -107,15 +117,6 @@ namespace MediaBrowser.ServerApplication
/// A that contains the event data.
protected override void OnStartup(StartupEventArgs e)
{
- bool createdNew;
- SingleInstanceMutex = new Mutex(true, @"Local\" + GetType().Assembly.GetName().Name, out createdNew);
- if (!createdNew)
- {
- SingleInstanceMutex = null;
- Shutdown();
- return;
- }
-
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
LoadKernel();
@@ -190,7 +191,10 @@ namespace MediaBrowser.ServerApplication
base.OnExit(e);
- CompositionRoot.Dispose();
+ if (CompositionRoot != null)
+ {
+ CompositionRoot.Dispose();
+ }
}
///
@@ -198,15 +202,15 @@ namespace MediaBrowser.ServerApplication
///
private void ReleaseMutex()
{
- if (SingleInstanceMutex == null)
+ if (_singleInstanceMutex == null)
{
return;
}
- SingleInstanceMutex.ReleaseMutex();
- SingleInstanceMutex.Close();
- SingleInstanceMutex.Dispose();
- SingleInstanceMutex = null;
+ _singleInstanceMutex.ReleaseMutex();
+ _singleInstanceMutex.Close();
+ _singleInstanceMutex.Dispose();
+ _singleInstanceMutex = null;
}
///
diff --git a/MediaBrowser.ServerApplication/MainWindow.xaml b/MediaBrowser.ServerApplication/MainWindow.xaml
index bbc7e64c8f..518c55a767 100644
--- a/MediaBrowser.ServerApplication/MainWindow.xaml
+++ b/MediaBrowser.ServerApplication/MainWindow.xaml
@@ -10,7 +10,7 @@
WindowStyle="None"
ShowInTaskbar="False">
-
+
@@ -35,32 +35,6 @@
-
-
-
-
diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
index b272dd4bf7..7fd8463a85 100644
--- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
+++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
@@ -333,14 +333,6 @@
-
-
-
-
-
-
-
-
False
diff --git a/MediaBrowser.ServerApplication/Resources/Images/Loading/1.ico b/MediaBrowser.ServerApplication/Resources/Images/Loading/1.ico
deleted file mode 100644
index 63acf6d33c..0000000000
Binary files a/MediaBrowser.ServerApplication/Resources/Images/Loading/1.ico and /dev/null differ
diff --git a/MediaBrowser.ServerApplication/Resources/Images/Loading/2.ico b/MediaBrowser.ServerApplication/Resources/Images/Loading/2.ico
deleted file mode 100644
index 6eb60cbe08..0000000000
Binary files a/MediaBrowser.ServerApplication/Resources/Images/Loading/2.ico and /dev/null differ
diff --git a/MediaBrowser.ServerApplication/Resources/Images/Loading/3.ico b/MediaBrowser.ServerApplication/Resources/Images/Loading/3.ico
deleted file mode 100644
index 7cde0746f3..0000000000
Binary files a/MediaBrowser.ServerApplication/Resources/Images/Loading/3.ico and /dev/null differ
diff --git a/MediaBrowser.ServerApplication/Resources/Images/Loading/4.ico b/MediaBrowser.ServerApplication/Resources/Images/Loading/4.ico
deleted file mode 100644
index db2a895a5f..0000000000
Binary files a/MediaBrowser.ServerApplication/Resources/Images/Loading/4.ico and /dev/null differ
diff --git a/MediaBrowser.ServerApplication/Resources/Images/Loading/5.ico b/MediaBrowser.ServerApplication/Resources/Images/Loading/5.ico
deleted file mode 100644
index 4c9c4fd0df..0000000000
Binary files a/MediaBrowser.ServerApplication/Resources/Images/Loading/5.ico and /dev/null differ
diff --git a/MediaBrowser.ServerApplication/Resources/Images/Loading/6.ico b/MediaBrowser.ServerApplication/Resources/Images/Loading/6.ico
deleted file mode 100644
index 6d2eba5488..0000000000
Binary files a/MediaBrowser.ServerApplication/Resources/Images/Loading/6.ico and /dev/null differ