Skip to content

Commit

Permalink
Fix the subtitle stream index calculation for multiple subtitles (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
cebrusfs authored Sep 5, 2024
1 parent 081a316 commit 9dea386
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Shared/Extensions/JellyfinAPI/MediaStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ extension [MediaStream] {

for (i, mediaStream) in mediaStreams.enumerated() {
guard mediaStream.isExternal ?? false else { continue }
var _mediaStream = mediaStream
_mediaStream.index = 1 + embeddedSubtitleCount + audioStreamCount
var copy = mediaStream
copy.index = (copy.index ?? 0) + 1 + embeddedSubtitleCount + audioStreamCount

mediaStreams[i] = _mediaStream
mediaStreams[i] = copy
}

return mediaStreams
Expand Down

0 comments on commit 9dea386

Please sign in to comment.