mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-27 06:30:29 +00:00
fix crash caused by reusing released MediaMetadataRetriever
This commit is contained in:
parent
dce3bbbc6d
commit
dab0f34497
1 changed files with 2 additions and 1 deletions
|
@ -32,7 +32,7 @@ class ChaosflixSeekDataProvider(
|
|||
private var canceled = true
|
||||
private var generateThumbsJob: Job? = null
|
||||
|
||||
private val mediaMetadataRetriever = MediaMetadataRetriever()
|
||||
private var mediaMetadataRetriever = MediaMetadataRetriever()
|
||||
|
||||
private val thumbnails: MutableMap<Long, Bitmap> = mutableMapOf()
|
||||
private val dummyThumbnails: MutableMap<Long, Bitmap> = mutableMapOf()
|
||||
|
@ -58,6 +58,7 @@ class ChaosflixSeekDataProvider(
|
|||
|
||||
override fun getSeekPositions(): LongArray {
|
||||
if (canceled) {
|
||||
mediaMetadataRetriever = MediaMetadataRetriever()
|
||||
mediaMetadataRetriever.setDataSource(url, mapOf("User-Agent" to ApiFactory.buildUserAgent()))
|
||||
generateThumbs()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue