mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Fixes for OS X. Allows for audio only, no video. It's almost unusable due to Mono's WinForms being so bad.
This commit is contained in:
parent
0d63370c10
commit
342d8c87d8
@ -47,12 +47,17 @@ namespace Nikse.SubtitleEdit.Core
|
|||||||
|
|
||||||
public static bool IsRunningOnLinux()
|
public static bool IsRunningOnLinux()
|
||||||
{
|
{
|
||||||
return Environment.OSVersion.Platform == PlatformID.Unix;
|
return Environment.OSVersion.Platform == PlatformID.Unix && !IsRunningOnMac();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsRunningOnMac()
|
public static bool IsRunningOnMac()
|
||||||
{
|
{
|
||||||
return Environment.OSVersion.Platform == PlatformID.MacOSX;
|
// Current versions of Mono report the platform as Unix
|
||||||
|
return Environment.OSVersion.Platform == PlatformID.MacOSX ||
|
||||||
|
(Environment.OSVersion.Platform == PlatformID.Unix &&
|
||||||
|
Directory.Exists("/Applications") &&
|
||||||
|
Directory.Exists("/System") &&
|
||||||
|
Directory.Exists("/Users"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string TesseractDataFolder
|
public static string TesseractDataFolder
|
||||||
|
@ -54,11 +54,15 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
encoderName = "VLC";
|
encoderName = "VLC";
|
||||||
string parameters = "\"" + inputVideoFile + "\" -I dummy -vvv --no-sout-video --audio-track=" + audioTrackNumber + " --sout=\"#transcode{acodec=s16l,channels=1,ab=128}:std{access=file,mux=wav,dst=" + outWaveFile + "}\" vlc://quit";
|
string parameters = "\"" + inputVideoFile + "\" -I dummy -vvv --no-sout-video --audio-track=" + audioTrackNumber + " --sout=\"#transcode{acodec=s16l,channels=1,ab=128}:std{access=file,mux=wav,dst=" + outWaveFile + "}\" vlc://quit";
|
||||||
string exeFilePath;
|
string exeFilePath;
|
||||||
if (Configuration.IsRunningOnLinux() || Configuration.IsRunningOnMac())
|
if (Configuration.IsRunningOnLinux())
|
||||||
{
|
{
|
||||||
exeFilePath = "cvlc";
|
exeFilePath = "cvlc";
|
||||||
parameters = "-vvv --no-sout-video --audio-track=" + audioTrackNumber + " --sout '#transcode{" + encodeParamters + "}:std{mux=wav,access=file,dst=" + outWaveFile + "}' \"" + inputVideoFile + "\" vlc://quit";
|
parameters = "-vvv --no-sout-video --audio-track=" + audioTrackNumber + " --sout '#transcode{" + encodeParamters + "}:std{mux=wav,access=file,dst=" + outWaveFile + "}' \"" + inputVideoFile + "\" vlc://quit";
|
||||||
}
|
}
|
||||||
|
else if (Configuration.IsRunningOnMac())
|
||||||
|
{
|
||||||
|
exeFilePath = "VLC.app/Contents/MacOS/VLC";
|
||||||
|
}
|
||||||
else // windows
|
else // windows
|
||||||
{
|
{
|
||||||
exeFilePath = Logic.VideoPlayers.LibVlcDynamic.GetVlcPath("vlc.exe");
|
exeFilePath = Logic.VideoPlayers.LibVlcDynamic.GetVlcPath("vlc.exe");
|
||||||
|
@ -189,11 +189,15 @@ namespace Nikse.SubtitleEdit.Logic
|
|||||||
{
|
{
|
||||||
GeneralSettings gs = Configuration.Settings.General;
|
GeneralSettings gs = Configuration.Settings.General;
|
||||||
|
|
||||||
if (Configuration.IsRunningOnLinux() || Configuration.IsRunningOnMac())
|
if (Configuration.IsRunningOnLinux())
|
||||||
return new MPlayer();
|
return new MPlayer();
|
||||||
|
|
||||||
//if (Utilities.IsRunningOnMac())
|
// Mono on OS X is 32 bit and thus requires 32 bit VLC. Place VLC in the same
|
||||||
// return new LibVlcMono();
|
// folder as Subtitle Edit and add this to the app.config inside the
|
||||||
|
// "configuration" element:
|
||||||
|
// <dllmap dll="libvlc" target="VLC.app/Contents/MacOS/lib/libvlc.dylib" />
|
||||||
|
if (Configuration.IsRunningOnMac())
|
||||||
|
return new LibVlcMono();
|
||||||
|
|
||||||
if (gs.VideoPlayer == "VLC" && LibVlcDynamic.IsInstalled)
|
if (gs.VideoPlayer == "VLC" && LibVlcDynamic.IsInstalled)
|
||||||
return new LibVlcDynamic();
|
return new LibVlcDynamic();
|
||||||
|
@ -265,10 +265,17 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
using (var vlc = new LibVlcDynamic())
|
try
|
||||||
{
|
{
|
||||||
vlc.Initialize(null, null, null, null);
|
using (var vlc = new LibVlcDynamic())
|
||||||
return vlc.IsAllMethodsLoaded();
|
{
|
||||||
|
vlc.Initialize(null, null, null, null);
|
||||||
|
return vlc.IsAllMethodsLoaded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user