Squashed commit of the following:
commitc7d9af4529
Author: Holger Müller <github@euhm.de> Date: Sat Apr 16 17:56:41 2022 +0200 fixed CI failure commit59e18bc5c0
Author: Holger Müller <github@euhm.de> Date: Sat Apr 16 17:42:49 2022 +0200 removed unused dataSourceFactory, commented debug output
This commit is contained in:
parent
762aeec5d3
commit
788538ee6a
|
@ -220,7 +220,7 @@ open class APIDataSource private constructor(
|
||||||
|
|
||||||
@Throws(HttpDataSourceException::class)
|
@Throws(HttpDataSourceException::class)
|
||||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||||
Timber.d("APIDatasource: Read: %s %s", offset, length)
|
// Timber.d("APIDatasource: Read: %s %s", offset, length)
|
||||||
return try {
|
return try {
|
||||||
readInternal(buffer, offset, length)
|
readInternal(buffer, offset, length)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
|
|
|
@ -85,8 +85,8 @@ class CachedDataSource(
|
||||||
|
|
||||||
@Suppress("MagicNumber")
|
@Suppress("MagicNumber")
|
||||||
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
override fun read(buffer: ByteArray, offset: Int, length: Int): Int {
|
||||||
if (offset > 0 || length > 4)
|
// if (offset > 0 || length > 4)
|
||||||
Timber.d("CachedDatasource: Read: %s %s", offset, length)
|
// Timber.d("CachedDatasource: Read: %s %s", offset, length)
|
||||||
return if (cachePath != null) {
|
return if (cachePath != null) {
|
||||||
try {
|
try {
|
||||||
readInternal(buffer, offset, length)
|
readInternal(buffer, offset, length)
|
||||||
|
|
|
@ -44,7 +44,6 @@ class PlaybackService : MediaLibraryService(), KoinComponent {
|
||||||
private lateinit var player: ExoPlayer
|
private lateinit var player: ExoPlayer
|
||||||
private lateinit var mediaLibrarySession: MediaLibrarySession
|
private lateinit var mediaLibrarySession: MediaLibrarySession
|
||||||
private lateinit var apiDataSource: APIDataSource.Factory
|
private lateinit var apiDataSource: APIDataSource.Factory
|
||||||
private lateinit var dataSourceFactory: DataSource.Factory
|
|
||||||
|
|
||||||
private lateinit var librarySessionCallback: MediaLibrarySession.MediaLibrarySessionCallback
|
private lateinit var librarySessionCallback: MediaLibrarySession.MediaLibrarySessionCallback
|
||||||
|
|
||||||
|
@ -102,14 +101,13 @@ class PlaybackService : MediaLibraryService(), KoinComponent {
|
||||||
|
|
||||||
// Create a MediaSource which passes calls through our OkHttp Stack
|
// Create a MediaSource which passes calls through our OkHttp Stack
|
||||||
apiDataSource = APIDataSource.Factory(subsonicAPIClient)
|
apiDataSource = APIDataSource.Factory(subsonicAPIClient)
|
||||||
|
|
||||||
dataSourceFactory = APIDataSource.Factory(subsonicAPIClient)
|
|
||||||
val cacheDataSourceFactory: DataSource.Factory = CachedDataSource.Factory(apiDataSource)
|
val cacheDataSourceFactory: DataSource.Factory = CachedDataSource.Factory(apiDataSource)
|
||||||
|
|
||||||
// Create a renderer with HW rendering support
|
// Create a renderer with HW rendering support
|
||||||
val renderer = DefaultRenderersFactory(this)
|
val renderer = DefaultRenderersFactory(this)
|
||||||
|
|
||||||
if (Settings.useHwOffload) renderer.setEnableAudioOffload(true)
|
if (Settings.useHwOffload)
|
||||||
|
renderer.setEnableAudioOffload(true)
|
||||||
|
|
||||||
// Create the player
|
// Create the player
|
||||||
player = ExoPlayer.Builder(this)
|
player = ExoPlayer.Builder(this)
|
||||||
|
|
Loading…
Reference in New Issue