Skip to content

Commit

Permalink
add language
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed Dec 10, 2023
1 parent 5c5f45b commit 73086f1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sources/KSPlayer/MEPlayer/FFmpegAssetTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ public class FFmpegAssetTrack: MediaPlayerTrack {
if bitRate > 0 {
description += ", \(bitRate.kmFormatted)bps"
}

if let language {
description += "(\(language))"
}
return description
}

Expand Down Expand Up @@ -94,7 +96,7 @@ public class FFmpegAssetTrack: MediaPlayerTrack {
}
}

if let value = metadata["language"] {
if let value = metadata["language"], value != "und" {
language = Locale.current.localizedString(forLanguageCode: value)
} else {
language = nil
Expand All @@ -103,9 +105,6 @@ public class FFmpegAssetTrack: MediaPlayerTrack {
name = value
} else {
name = codecName
if let language {
name += "(\(language))"
}
}
// AV_DISPOSITION_DEFAULT
if mediaType == .subtitle {
Expand Down

0 comments on commit 73086f1

Please sign in to comment.