mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #7443 from whiteowl3/strm-probe
This commit is contained in:
commit
8056b0e961
@ -461,14 +461,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
using (var processWrapper = new ProcessWrapper(process, this))
|
using (var processWrapper = new ProcessWrapper(process, this))
|
||||||
{
|
{
|
||||||
|
await using var memoryStream = new MemoryStream();
|
||||||
_logger.LogDebug("Starting ffprobe with args {Args}", args);
|
_logger.LogDebug("Starting ffprobe with args {Args}", args);
|
||||||
StartProcess(processWrapper);
|
StartProcess(processWrapper);
|
||||||
|
await process.StandardOutput.BaseStream.CopyToAsync(memoryStream, cancellationToken: cancellationToken);
|
||||||
|
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
InternalMediaInfoResult result;
|
InternalMediaInfoResult result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = await JsonSerializer.DeserializeAsync<InternalMediaInfoResult>(
|
result = await JsonSerializer.DeserializeAsync<InternalMediaInfoResult>(
|
||||||
process.StandardOutput.BaseStream,
|
memoryStream,
|
||||||
_jsonSerializerOptions,
|
_jsonSerializerOptions,
|
||||||
cancellationToken: cancellationToken).ConfigureAwait(false);
|
cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,8 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
var mediaStreams = new List<MediaStream>();
|
var mediaStreams = new List<MediaStream>();
|
||||||
|
|
||||||
foreach (var pathInfo in pathInfos)
|
foreach (var pathInfo in pathInfos)
|
||||||
|
{
|
||||||
|
if (!pathInfo.Path.AsSpan().EndsWith(".strm", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var mediaInfo = await GetMediaInfo(pathInfo.Path, _type, cancellationToken).ConfigureAwait(false);
|
var mediaInfo = await GetMediaInfo(pathInfo.Path, _type, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
@ -121,6 +123,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return mediaStreams.AsReadOnly();
|
return mediaStreams.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user