Apply suggestions from code review

Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
Nyanmisaka 2022-05-09 17:09:03 +08:00 committed by GitHub
parent 4b1256e67b
commit 5386f06095
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -776,9 +776,8 @@ namespace MediaBrowser.Model.Dlna
if (directVideoCodec != null) if (directVideoCodec != null)
{ {
// merge directVideoCodec to videoCodecs // merge directVideoCodec to videoCodecs
videoCodecs = videoCodecs != null && videoCodecs.Length > 0 Array.Resize(ref videoCodecs, (videoCodecs?.Length ?? 0) + 1);
? videoCodecs.Union(new[] { directVideoCodec }).ToArray() videoCodecs[^1] = directVideoCodec;
: new[] { directVideoCodec };
} }
playlistItem.VideoCodecs = videoCodecs; playlistItem.VideoCodecs = videoCodecs;