Enable HW playback for better performance

This commit is contained in:
tzugen 2022-04-04 18:28:23 +02:00
parent b1c2d020b5
commit 2f7f47783a
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 2 additions and 8 deletions

View File

@ -184,12 +184,6 @@ class PlaybackService : MediaLibraryService(), KoinComponent {
// Create a MediaSource which passes calls through our OkHttp Stack
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)
// Create a renderer with HW rendering support
@ -202,11 +196,11 @@ class PlaybackService : MediaLibraryService(), KoinComponent {
.setWakeMode(C.WAKE_MODE_NETWORK)
.setHandleAudioBecomingNoisy(true)
.setMediaSourceFactory(DefaultMediaSourceFactory(cacheDataSourceFactory))
// .setRenderersFactory(renderer)
.setRenderersFactory(renderer)
.build()
// Enable audio offload
// player.experimentalSetOffloadSchedulingEnabled(true)
player.experimentalSetOffloadSchedulingEnabled(true)
MediaItemTree.initialize(assets)