|
@@ -15,7 +15,7 @@ namespace Bmp.Core.Playback.Inputs
|
|
|
AttachedPic[]? mappedEmbeddedPics = null;
|
|
|
try
|
|
|
{
|
|
|
- using var decoder = new FfmpegDecoder(urlOrPath);
|
|
|
+ using var decoder = new FfmpegDecoder(ProcessUrlOrPathForFFMPEG(urlOrPath));
|
|
|
|
|
|
var fp = decoder.AttachedPics;
|
|
|
|
|
@@ -53,15 +53,10 @@ namespace Bmp.Core.Playback.Inputs
|
|
|
|
|
|
public static MetaData ReadMeta(string urlOrPath)
|
|
|
{
|
|
|
- if (Uri.TryCreate(urlOrPath, UriKind.Absolute, out var url))
|
|
|
- {
|
|
|
- if (url.IsFile) urlOrPath = url.LocalPath;
|
|
|
- }
|
|
|
-
|
|
|
FfmpegDecoder? decoder = null;
|
|
|
try
|
|
|
{
|
|
|
- decoder = new FfmpegDecoder(urlOrPath);
|
|
|
+ decoder = new FfmpegDecoder(ProcessUrlOrPathForFFMPEG(urlOrPath));
|
|
|
|
|
|
return new MetaData
|
|
|
{
|
|
@@ -71,10 +66,7 @@ namespace Bmp.Core.Playback.Inputs
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
- return new MetaData
|
|
|
- {
|
|
|
- Error = e,
|
|
|
- };
|
|
|
+ return new MetaData { Error = e };
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
@@ -100,11 +92,7 @@ namespace Bmp.Core.Playback.Inputs
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (Uri.TryCreate(urlOrPath, UriKind.Absolute, out var url))
|
|
|
- {
|
|
|
- if (url.IsFile) urlOrPath = url.LocalPath;
|
|
|
- }
|
|
|
- return new FFMPEGAudioReader(urlOrPath);
|
|
|
+ return new FFMPEGAudioReader(ProcessUrlOrPathForFFMPEG(urlOrPath));
|
|
|
}
|
|
|
|
|
|
public static string[] ExpandPaths(string inputPath)
|
|
@@ -167,6 +155,18 @@ namespace Bmp.Core.Playback.Inputs
|
|
|
"SCANS/Cover.png"
|
|
|
};
|
|
|
|
|
|
+ private static string ProcessUrlOrPathForFFMPEG(string urlOrPath)
|
|
|
+ {
|
|
|
+ var processedUrlOrPath = urlOrPath;
|
|
|
+ if (Uri.TryCreate(urlOrPath, UriKind.Absolute, out var url))
|
|
|
+ {
|
|
|
+ if (url.IsFile) processedUrlOrPath = url.LocalPath;
|
|
|
+ else if (url.IsAbsoluteUri) processedUrlOrPath = url.AbsoluteUri;
|
|
|
+ }
|
|
|
+
|
|
|
+ return processedUrlOrPath;
|
|
|
+ }
|
|
|
+
|
|
|
public static (bool exists, long? size) FileCheckSize(string urlOrPath)
|
|
|
{
|
|
|
var exists = false;
|