mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Code Clean up: Use Pattern Matching (#5838)
Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
This commit is contained in:
@@ -61,33 +61,25 @@ namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
|
||||
foreach (var stream in playlist.SortedStreams)
|
||||
{
|
||||
var videoStream = stream as TSVideoStream;
|
||||
|
||||
if (videoStream != null)
|
||||
if (stream is TSVideoStream videoStream)
|
||||
{
|
||||
AddVideoStream(mediaStreams, videoStream);
|
||||
continue;
|
||||
}
|
||||
|
||||
var audioStream = stream as TSAudioStream;
|
||||
|
||||
if (audioStream != null)
|
||||
if (stream is TSAudioStream audioStream)
|
||||
{
|
||||
AddAudioStream(mediaStreams, audioStream);
|
||||
continue;
|
||||
}
|
||||
|
||||
var textStream = stream as TSTextStream;
|
||||
|
||||
if (textStream != null)
|
||||
if (stream is TSTextStream textStream)
|
||||
{
|
||||
AddSubtitleStream(mediaStreams, textStream);
|
||||
continue;
|
||||
}
|
||||
|
||||
var graphicsStream = stream as TSGraphicsStream;
|
||||
|
||||
if (graphicsStream != null)
|
||||
if (stream is TSGraphicsStream graphicsStream)
|
||||
{
|
||||
AddSubtitleStream(mediaStreams, graphicsStream);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user