File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Armadillo/src/main/java/com/scribd/armadillo Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ import io.reactivex.disposables.CompositeDisposable
4646import io.reactivex.disposables.Disposable
4747import io.reactivex.subjects.BehaviorSubject
4848import java.util.concurrent.TimeUnit
49+ import java.util.concurrent.locks.ReentrantLock
4950import javax.inject.Inject
51+ import kotlin.concurrent.withLock
5052
5153/* *
5254 * The client will use [ArmadilloPlayer] to communicate with the [ArmadilloPlayerChoreographer].
@@ -248,6 +250,8 @@ internal class ArmadilloPlayerChoreographer : ArmadilloPlayer {
248250
249251 private var isDownloadEngineInit = false
250252
253+ private val cacheLock = ReentrantLock ()
254+
251255 /* *
252256 * Used to delegates all actions to the player. ex. [MediaControllerCompat.TransportControls.play]
253257 */
@@ -282,7 +286,9 @@ internal class ArmadilloPlayerChoreographer : ArmadilloPlayer {
282286 }
283287
284288 override fun clearCache () = runHandler {
285- cacheManager.clearPlaybackCache()
289+ cacheLock.withLock {
290+ cacheManager.clearPlaybackCache()
291+ }
286292 }
287293
288294 override fun removeAllDownloads () = runHandler {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx1536m
1313# org.gradle.parallel=true
1414PACKAGE_NAME =com.scribd.armadillo
1515GRADLE_PLUGIN_VERSION =7.2.0
16- LIBRARY_VERSION =1.7.0
16+ LIBRARY_VERSION =1.7.1
1717EXOPLAYER_VERSION =2.19.1
1818RXJAVA_VERSION =2.2.4
1919RXANDROID_VERSION =2.0.1
You can’t perform that action at this time.
0 commit comments