Enable HW playback for better performance
This commit is contained in:
parent
b1c2d020b5
commit
2f7f47783a
|
@ -184,12 +184,6 @@ class PlaybackService : MediaLibraryService(), KoinComponent {
|
||||||
|
|
||||||
// Create a MediaSource which passes calls through our OkHttp Stack
|
// Create a MediaSource which passes calls through our OkHttp Stack
|
||||||
dataSourceFactory = APIDataSource.Factory(subsonicAPIClient)
|
dataSourceFactory = APIDataSource.Factory(subsonicAPIClient)
|
||||||
|
|
||||||
// A download cache should not evict media, so should use a NoopCacheEvictor.
|
|
||||||
// A download cache should not evict media, so should use a NoopCacheEvictor.
|
|
||||||
// TODO: Add cache: https://stackoverflow.com/questions/28700391/using-cache-in-exoplayer
|
|
||||||
// var cache = UltrasonicCache()
|
|
||||||
//
|
|
||||||
val cacheDataSourceFactory: DataSource.Factory = CachedDataSource.Factory(dataSourceFactory)
|
val cacheDataSourceFactory: DataSource.Factory = CachedDataSource.Factory(dataSourceFactory)
|
||||||
|
|
||||||
// Create a renderer with HW rendering support
|
// Create a renderer with HW rendering support
|
||||||
|
@ -202,11 +196,11 @@ class PlaybackService : MediaLibraryService(), KoinComponent {
|
||||||
.setWakeMode(C.WAKE_MODE_NETWORK)
|
.setWakeMode(C.WAKE_MODE_NETWORK)
|
||||||
.setHandleAudioBecomingNoisy(true)
|
.setHandleAudioBecomingNoisy(true)
|
||||||
.setMediaSourceFactory(DefaultMediaSourceFactory(cacheDataSourceFactory))
|
.setMediaSourceFactory(DefaultMediaSourceFactory(cacheDataSourceFactory))
|
||||||
// .setRenderersFactory(renderer)
|
.setRenderersFactory(renderer)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
// Enable audio offload
|
// Enable audio offload
|
||||||
// player.experimentalSetOffloadSchedulingEnabled(true)
|
player.experimentalSetOffloadSchedulingEnabled(true)
|
||||||
|
|
||||||
MediaItemTree.initialize(assets)
|
MediaItemTree.initialize(assets)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue