From 2f7f47783a755ce089197d26b9af50f50a2ea9a1 Mon Sep 17 00:00:00 2001 From: tzugen Date: Mon, 4 Apr 2022 18:28:23 +0200 Subject: [PATCH] Enable HW playback for better performance --- .../org/moire/ultrasonic/playback/PlaybackService.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/PlaybackService.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/PlaybackService.kt index 3a102ec3..bfad720a 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/PlaybackService.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/playback/PlaybackService.kt @@ -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)