Skip to content

Commit 570c973

Browse files
authored
Merge pull request #60 from Mountains-0/master
Fix track id comparison logic
2 parents 044bab1 + 4c8875c commit 570c973

File tree

1 file changed

+2
-2
lines changed
  • lib_ass_media/src/main/java/io/github/peerless2012/ass/media

1 file changed

+2
-2
lines changed

lib_ass_media/src/main/java/io/github/peerless2012/ass/media/AssHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ class AssHandler(val renderType: AssRenderType) : Listener {
147147
val track = availableTracks.firstNotNullOfOrNull {
148148
// When media without external subtitles, format id will not change.
149149
// When media with external subtitles, format will become like 1:1 .
150-
// So to compat both situation, we just use endsWith.
151-
if (format?.id?.endsWith(it.key) == true) {
150+
// So to compat both situation, we extract the actual id after the colon.
151+
if (format?.id?.substringAfter(":") == it.key) {
152152
it.value
153153
} else {
154154
null

0 commit comments

Comments
 (0)