Fix the subtitle stream index calculation for multiple subtitles (#1219)

This commit is contained in:
Meng-Huan Yu 2024-09-06 04:46:27 +09:00 committed by GitHub
parent 081a316843
commit 9dea386a8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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