mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Update M3u8Helper.kt
This commit is contained in:
parent
b1dad6cd82
commit
6ff755c8f4
1 changed files with 3 additions and 3 deletions
|
@ -118,7 +118,7 @@ class M3u8Helper {
|
||||||
)
|
)
|
||||||
|
|
||||||
public fun hlsYield(qualities: List<M3u8Stream>): Iterator<HlsDownloadData> {
|
public fun hlsYield(qualities: List<M3u8Stream>): Iterator<HlsDownloadData> {
|
||||||
if (qualities.isEmpty()) return listOf<HlsDownloadData>().iterator()
|
if (qualities.isEmpty()) return listOf<HlsDownloadData>(HlsDownloadData(byteArrayOf(), 0, 0, true)).iterator()
|
||||||
|
|
||||||
var selected = selectBest(qualities)
|
var selected = selectBest(qualities)
|
||||||
if (selected == null) {
|
if (selected == null) {
|
||||||
|
@ -156,7 +156,7 @@ class M3u8Helper {
|
||||||
val allTs = TS_EXTENSION_REGEX.findAll(m3u8Data)
|
val allTs = TS_EXTENSION_REGEX.findAll(m3u8Data)
|
||||||
val totalTs = allTs.toList().size
|
val totalTs = allTs.toList().size
|
||||||
if (totalTs == 0) {
|
if (totalTs == 0) {
|
||||||
return listOf<HlsDownloadData>().iterator()
|
return listOf<HlsDownloadData>(HlsDownloadData(byteArrayOf(), 0, 0, true)).iterator()
|
||||||
}
|
}
|
||||||
var lastYield = 0
|
var lastYield = 0
|
||||||
|
|
||||||
|
@ -196,6 +196,6 @@ class M3u8Helper {
|
||||||
}
|
}
|
||||||
return tsByteGen.iterator()
|
return tsByteGen.iterator()
|
||||||
}
|
}
|
||||||
return listOf<HlsDownloadData>().iterator()
|
return listOf<HlsDownloadData>(HlsDownloadData(byteArrayOf(), 0, 0, true)).iterator()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue