mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 23:58:57 +00:00
Add IDisposableAnalyzers to more projects
This commit is contained in:
@@ -29,8 +29,12 @@
|
||||
<PackageReference Include="UTF.Unknown" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Code Analyzers-->
|
||||
<!-- Code Analyzers -->
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<PackageReference Include="IDisposableAnalyzers">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
|
||||
@@ -135,19 +135,17 @@ namespace MediaBrowser.MediaEncoding.Subtitles
|
||||
var subtitleStream = mediaSource.MediaStreams
|
||||
.First(i => i.Type == MediaStreamType.Subtitle && i.Index == subtitleStreamIndex);
|
||||
|
||||
var subtitle = await GetSubtitleStream(mediaSource, subtitleStream, cancellationToken)
|
||||
var (stream, inputFormat) = await GetSubtitleStream(mediaSource, subtitleStream, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
var inputFormat = subtitle.Format;
|
||||
|
||||
// Return the original if the same format is being requested
|
||||
// Character encoding was already handled in GetSubtitleStream
|
||||
if (string.Equals(inputFormat, outputFormat, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return subtitle.Stream;
|
||||
return stream;
|
||||
}
|
||||
|
||||
using (var stream = subtitle.Stream)
|
||||
using (stream)
|
||||
{
|
||||
return ConvertSubtitles(stream, inputFormat, outputFormat, startTimeTicks, endTimeTicks, preserveOriginalTimestamps, cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user