Top level values can be only accessed from the main thread. (#1922)
This commit is contained in:
@@ -20,6 +20,7 @@ import kotlinx.cinterop.*
|
||||
import platform.posix.memcpy
|
||||
|
||||
// This global variable only set to != null value in the decoding worker.
|
||||
@ThreadLocal
|
||||
private var decoder: Decoder? = null
|
||||
|
||||
data class VideoInfo(val size: Dimensions, val fps: Double)
|
||||
|
||||
@@ -76,6 +76,7 @@ class SDLAudio(val player: VideoPlayer) : DisposableContainer() {
|
||||
}
|
||||
|
||||
// Only set in the audio thread
|
||||
@ThreadLocal
|
||||
private var decoder: DecoderWorker? = null
|
||||
|
||||
private fun audioCallback(userdata: COpaquePointer?, buffer: CPointer<Uint8Var>?, length: Int) {
|
||||
|
||||
Reference in New Issue
Block a user