livekit / client-sdk-android

LiveKit SDK for Android
https://docs.livekit.io
Apache License 2.0
196 stars 79 forks source link

Crash When remove audio track addSink(xxx) #549

Open liuyang2211 opened 8 hours ago

liuyang2211 commented 8 hours ago

Describe the bug When I wanted to obtain remote audio stream data in a way similar to getting local audio stream data, an exception crash occurred.

is RoomEvent.ActiveSpeakersChanged -> { if (event.speakers.isEmpty()) return@collect event.speakers.firstOrNull()!!::audioTrackPublications.flow .flatMapLatest { tracks -> Log.d("-------", "tracks change") if (tracks.firstOrNull()?.first?.track !is LocalAudioTrack) { val audioSteamData = tracks.firstOrNull()?.first?.track as? RemoteAudioTrack audioSteamData?.addSink(audioSinkActive) } flowOf(tracks) } }

private val audioSinkActive = AudioTrackSink { p0, p1, p2, p3, p4, p5 -> Log.d( "-------", "Manager: audioSinkActive: p0:$p0\n" + " p1:$p1\n" + " p2:$p2\n" + " p3:$p3\n" + " p4:$p4\n" + " p5:$p5" )

}

Device Info:

Additional context Add any other context about the problem here.

liuyang2211 commented 8 hours ago

#

Fatal error in: gen/jni_headers/sdk/android/generated_peerconnection_jni/../../../../../../../../../../../_source/android_prefixed/webrtc/src/sdk/android/src/jni/jni_generator_helper.h, line 105

last system error: 95

Check failed: !env->ExceptionCheck()