audio player: don't exceed source limit; increase source limit

This commit is contained in:
Bixilon 2023-06-25 01:00:27 +02:00
parent 0b7b6261da
commit c0e76181bd
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 3 additions and 3 deletions

View File

@ -173,7 +173,7 @@ class AudioPlayer(
}
}
// no source available
if (sources.size > SoundConstants.MAX_SOURCES_AMOUNT) {
if (sources.size >= SoundConstants.MAX_SOURCES_AMOUNT) {
return null
}
val source = SoundSource()

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2021 Moritz Zwerger
* Copyright (C) 2020-2023 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -17,5 +17,5 @@ object SoundConstants {
const val PRELOAD_ALL_SOUNDS = false
const val DISABLE_PRELOADING = false
const val MAX_SOURCES_AMOUNT = 32
const val MAX_SOURCES_AMOUNT = 127
}