Fixed not closed connection in CachedDataSource
This commit is contained in:
parent
926081f84c
commit
faf07f2887
|
@ -27,7 +27,7 @@ import timber.log.Timber
|
||||||
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
|
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
|
||||||
class CachedDataSource(
|
class CachedDataSource(
|
||||||
private var upstreamDataSource: DataSource
|
private var upstreamDataSource: DataSource
|
||||||
) : BaseDataSource(false) {
|
) : BaseDataSource(true) {
|
||||||
|
|
||||||
class Factory(
|
class Factory(
|
||||||
private var upstreamDataSourceFactory: DataSource.Factory
|
private var upstreamDataSourceFactory: DataSource.Factory
|
||||||
|
@ -186,6 +186,8 @@ class CachedDataSource(
|
||||||
transferEnded()
|
transferEnded()
|
||||||
responseByteStream?.close()
|
responseByteStream?.close()
|
||||||
responseByteStream = null
|
responseByteStream = null
|
||||||
|
} else {
|
||||||
|
upstreamDataSource.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue