diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-06 19:58:46 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-06 19:58:46 -0400 |
| commit | f02f3222085311b2a2cacab6642ad987a4176e65 (patch) | |
| tree | 9f317e5a3f087d4b4c5e523a8d8552d7d248567e /MediaBrowser.ServerApplication/FFMpeg | |
| parent | a9eed234ba2a366fe014f0cc6f462c3764528948 (diff) | |
remove mono compiler directives
Diffstat (limited to 'MediaBrowser.ServerApplication/FFMpeg')
| -rw-r--r-- | MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs | 43 | ||||
| -rw-r--r-- | MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs | 28 |
2 files changed, 33 insertions, 38 deletions
diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index 9070671484..01eef25d9a 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -1,9 +1,5 @@ -using System; -#if __MonoCS__ -using Mono.Unix.Native; -using System.Text.RegularExpressions; -using System.IO; -#endif +using Mono.Unix.Native; +using System; using System.IO; using System.Text.RegularExpressions; @@ -33,7 +29,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "20140827"; + return "20141005"; case "FFMpegFilename": return "ffmpeg.exe"; case "FFProbeFilename": @@ -82,7 +78,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "20140506"; + return "20140716"; case "FFMpegFilename": return "ffmpeg"; case "FFProbeFilename": @@ -98,7 +94,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "20140505"; + return "20140716"; case "FFMpegFilename": return "ffmpeg"; case "FFProbeFilename": @@ -138,15 +134,15 @@ namespace MediaBrowser.ServerApplication.FFMpeg { return new[] { - "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20140827-git-9e8ab36-win64-static.7z", - "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20140827-git-9e8ab36-win64-static.7z" + "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20141005-git-e079d43-win64-static.7z", + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141005-git-e079d43-win64-static.7z" }; } return new[] { - "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140827-git-9e8ab36-win32-static.7z", - "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20140827-git-9e8ab36-win32-static.7z" + "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20141005-git-e079d43-win32-static.7z", + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141005-git-e079d43-win32-static.7z" }; case PlatformID.Unix: @@ -173,7 +169,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg return new[] { "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.latest.tar.gz", - "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.32bit.2014-05-06.tar.gz" + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.32bit.2014-07-16.tar.gz" }; } @@ -182,7 +178,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg return new[] { "http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz", - "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.64bit.2014-05-05.tar.gz" + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.64bit.2014-07-16.tar.gz" }; } @@ -237,16 +233,13 @@ namespace MediaBrowser.ServerApplication.FFMpeg private static Uname GetUnixName() { var uname = new Uname(); - -#if __MonoCS__ - Utsname utsname; - var callResult = Syscall.uname(out utsname); - if (callResult == 0) - { - uname.sysname= utsname.sysname; - uname.machine= utsname.machine; - } -#endif + Utsname utsname; + var callResult = Syscall.uname(out utsname); + if (callResult == 0) + { + uname.sysname = utsname.sysname; + uname.machine = utsname.machine; + } return uname; } } diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs index 59c2940e66..cc289faf29 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs @@ -1,20 +1,18 @@ -using System.Collections.Generic; -using MediaBrowser.Common.Configuration; +using MediaBrowser.Common.Configuration; using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Net; +using MediaBrowser.ServerApplication.IO; +using Mono.Unix.Native; using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; -#if __MonoCS__ -using Mono.Unix.Native; -#endif -using MediaBrowser.ServerApplication.IO; namespace MediaBrowser.ServerApplication.FFMpeg { @@ -228,13 +226,8 @@ namespace MediaBrowser.ServerApplication.FFMpeg })) { File.Copy(file, Path.Combine(targetFolder, Path.GetFileName(file)), true); - #if __MonoCS__ - //Linux: File permission to 666, and user's execute bit - if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) - { - Syscall.chmod(Path.Combine(targetFolder, Path.GetFileName(file)), FilePermissions.DEFFILEMODE | FilePermissions.S_IXUSR); - } - #endif + + SetFilePermissions(targetFolder, file); } } finally @@ -243,6 +236,15 @@ namespace MediaBrowser.ServerApplication.FFMpeg } } + private void SetFilePermissions(string targetFolder, string file) + { + // Linux: File permission to 666, and user's execute bit + if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) + { + Syscall.chmod(Path.Combine(targetFolder, Path.GetFileName(file)), FilePermissions.DEFFILEMODE | FilePermissions.S_IXUSR); + } + } + private void ExtractArchive(string archivePath, string targetPath) { _logger.Info("Extracting {0} to {1}", archivePath, targetPath); |
