mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-14 02:04:14 +01:00
Merge pull request #100 from samburovkv/PipeHelpersGetPipePathFix
Fix pipe path for unix.
This commit is contained in:
commit
f47077792c
1 changed files with 4 additions and 1 deletions
|
@ -1,10 +1,13 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace FFMpegCore.Pipes
|
namespace FFMpegCore.Pipes
|
||||||
{
|
{
|
||||||
static class PipeHelpers
|
static class PipeHelpers
|
||||||
{
|
{
|
||||||
|
static readonly string PipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_");
|
||||||
|
|
||||||
public static string GetUnqiuePipeName() => "FFMpegCore_" + Guid.NewGuid();
|
public static string GetUnqiuePipeName() => "FFMpegCore_" + Guid.NewGuid();
|
||||||
|
|
||||||
public static string GetPipePath(string pipeName)
|
public static string GetPipePath(string pipeName)
|
||||||
|
@ -12,7 +15,7 @@ public static string GetPipePath(string pipeName)
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
return $@"\\.\pipe\{pipeName}";
|
return $@"\\.\pipe\{pipeName}";
|
||||||
else
|
else
|
||||||
return $"unix:/tmp/CoreFxPipe_{pipeName}"; // dotnet uses unix sockets on unix, for more see https://github.com/dotnet/runtime/issues/24390
|
return $"unix:{PipePrefix}{pipeName}"; // dotnet uses unix sockets on unix, for more see https://github.com/dotnet/runtime/issues/24390
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue