Skip to content

Commit

Permalink
Extract the preferred languages into a own variable
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulWoitaschek committed Jul 19, 2017
1 parent 88959ab commit e168d43
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ object MatroskaChapterReader {
fun read(file: File): SparseArray<String> {
try {
val chapters = ReadAsMatroskaChapters.read(file)
return MatroskaChapterFlattener.toSparseArray(chapters, listOf(Locale.getDefault().isO3Language, "eng"))
val preferredLanguages = listOf(Locale.getDefault().isO3Language, "eng")
return MatroskaChapterFlattener.toSparseArray(chapters, preferredLanguages)
} catch (ex: RuntimeException) {
// JEBML documentation just say's that it throws RuntimeException.
// For example NullPointerException is thrown if unknown EBML Element
Expand Down

0 comments on commit e168d43

Please sign in to comment.