aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
diff options
context:
space:
mode:
authorStanislav Ionascu <stanislav.ionascu@gmail.com>2020-09-24 08:41:42 +0200
committerStanislav Ionascu <stanislav.ionascu@gmail.com>2020-10-01 21:59:57 +0200
commit3ad62329731c1156566bd707f21cad60e74f9a5f (patch)
tree76b1c4b335bdf9d74929d0d04ac8cedf4a1f7ec7 /MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
parentc7b3d4a90c946f9a2438622cc0ca43d19b84bef8 (diff)
Add probe / direct-stream / transcoding support for BluRays
This commit (and ffmpeg built with libbluray support), adds support for playback of bluray images (bd-iso) and bluray folders.
Diffstat (limited to 'MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
index 21b5d0c5b..466fd75e1 100644
--- a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
+++ b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
@@ -87,19 +87,19 @@ namespace MediaBrowser.MediaEncoding.Attachments
MediaAttachment mediaAttachment,
CancellationToken cancellationToken)
{
- var attachmentPath = await GetReadableFile(mediaSource.Path, mediaSource.Path, mediaSource.Protocol, mediaAttachment, cancellationToken).ConfigureAwait(false);
+ var attachmentPath = await GetReadableFile(mediaSource.Path, mediaSource.Path, mediaSource, mediaAttachment, cancellationToken).ConfigureAwait(false);
return File.OpenRead(attachmentPath);
}
private async Task<string> GetReadableFile(
string mediaPath,
string inputFile,
- MediaProtocol protocol,
+ MediaSourceInfo mediaSource,
MediaAttachment mediaAttachment,
CancellationToken cancellationToken)
{
- var outputPath = GetAttachmentCachePath(mediaPath, protocol, mediaAttachment.Index);
- await ExtractAttachment(inputFile, protocol, mediaAttachment.Index, outputPath, cancellationToken)
+ var outputPath = GetAttachmentCachePath(mediaPath, mediaSource, mediaAttachment.Index);
+ await ExtractAttachment(inputFile, mediaSource, mediaAttachment.Index, outputPath, cancellationToken)
.ConfigureAwait(false);
return outputPath;
@@ -107,7 +107,7 @@ namespace MediaBrowser.MediaEncoding.Attachments
private async Task ExtractAttachment(
string inputFile,
- MediaProtocol protocol,
+ MediaSourceInfo mediaSource,
int attachmentStreamIndex,
string outputPath,
CancellationToken cancellationToken)
@@ -121,7 +121,7 @@ namespace MediaBrowser.MediaEncoding.Attachments
if (!File.Exists(outputPath))
{
await ExtractAttachmentInternal(
- _mediaEncoder.GetInputArgument(new[] { inputFile }, protocol),
+ _mediaEncoder.GetInputArgument(new[] { inputFile }, mediaSource),
attachmentStreamIndex,
outputPath,
cancellationToken).ConfigureAwait(false);
@@ -234,10 +234,10 @@ namespace MediaBrowser.MediaEncoding.Attachments
}
}
- private string GetAttachmentCachePath(string mediaPath, MediaProtocol protocol, int attachmentStreamIndex)
+ private string GetAttachmentCachePath(string mediaPath, MediaSourceInfo mediaSource, int attachmentStreamIndex)
{
string filename;
- if (protocol == MediaProtocol.File)
+ if (mediaSource.Protocol == MediaProtocol.File)
{
var date = _fileSystem.GetLastWriteTimeUtc(mediaPath);
filename = (mediaPath + attachmentStreamIndex.ToString(CultureInfo.InvariantCulture) + "_" + date.Ticks.ToString(CultureInfo.InvariantCulture)).GetMD5().ToString("D", CultureInfo.InvariantCulture);