Handle gstreamer audio init better

This commit is contained in:
Flamefire committed 2014-09-25 19:11:03 +02:00
1 parent c156fa69ab
commit 0611148ec4
1 file changed
+11 -3
@@ -17,6 +17,7 @@
using Gst; using Gst;
using System; using System;
using Vocaluxe.Base;
namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
{ {
@@ -26,13 +27,20 @@ namespace Vocaluxe.Lib.Sound.Playback.GstreamerSharp
{ {
if (_Initialized) if (_Initialized)
return false; return false;
#if ARCH_X86 #if ARCH_X86
var gstreamerEnvVar = Environment.GetEnvironmentVariable("GSTREAMER_1_0_ROOT_X86", EnvironmentVariableTarget.User); const string varName = "GSTREAMER_1_0_ROOT_X86";
#endif #endif
#if ARCH_X64 #if ARCH_X64
var gstreamerEnvVar = Environment.GetEnvironmentVariable("GSTREAMER_1_0_ROOT_X86_64", EnvironmentVariableTarget.User); const string varName = "GSTREAMER_1_0_ROOT_X86_64";
#endif #endif
var dllDirectory = gstreamerEnvVar + "bin\\"; string gstreamerEnvVar = Environment.GetEnvironmentVariable(varName, EnvironmentVariableTarget.User);
if (gstreamerEnvVar == null)
{
CLog.LogError("Gstreamer not found! Make sure you installed it correctly and if it set the environment variable '" + varName + "'!", true);
return false;
}
string dllDirectory = gstreamerEnvVar + "bin\\";
COSFunctions.AddEnvironmentPath(dllDirectory); COSFunctions.AddEnvironmentPath(dllDirectory);
Application.Init(); Application.Init();