Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
livekitAndroidXuningTest
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
davidliu
2024-01-18 23:54:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-01-18 23:54:33 +0900
Commit
a0d169049408722c1b9463cba2c3b373679b3fe9
a0d16904
1 parent
56f94dc7
Fix restartTrack causing crash on disconnect (#361)
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
14 行增加
和
4 行删除
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
livekit-android-sdk/src/main/java/io/livekit/android/room/track/LocalVideoTrack.kt
livekit-android-sdk/src/main/java/io/livekit/android/room/participant/LocalParticipant.kt
查看文件 @
a0d1690
...
...
@@ -787,10 +787,14 @@ internal constructor(
if (track != null) {
track.stop()
unpublishTrack(track)
unpublishTrack(track
, stopOnUnpublish = false
)
// We have the original track object reference, meaning we own it. Dispose here.
track.dispose()
try {
track.dispose()
} catch (e: Exception) {
LKLog.d(e) { "Exception thrown when cleaning up local participant track $pub:" }
}
}
}
}
...
...
livekit-android-sdk/src/main/java/io/livekit/android/room/track/LocalVideoTrack.kt
查看文件 @
a0d1690
...
...
@@ -226,9 +226,15 @@ constructor(
oldCapturer.dispose()
oldSource.dispose()
// sender owns rtcTrack, so it'll take care of disposing it.
oldRtcTrack.setEnabled(false)
// We always own our copy of rtcTrack, so we need to dispose it.
// Note: For the first rtcTrack we pass to the PeerConnection, PeerConnection actually
// passes it down to the native, and then ends up holding onto a separate copy at the
// Java layer. This means our initial rtcTrack isn't owned by PeerConnection, and is
// our responsibility to dispose.
oldRtcTrack.dispose()
// Close resources associated to the old track. new track resources is registered in createTrack.
val oldCloseable = closeableManager.unregisterResource(oldRtcTrack)
oldCloseable?.close()
...
...
@@ -253,7 +259,7 @@ constructor(
rtcTrack = newTrack.rtcTrack
this.options = options
startCapture()
sender?.setTrack(newTrack.rtcTrack,
tru
e)
sender?.setTrack(newTrack.rtcTrack,
fals
e)
}
internal fun setPublishingLayers(
...
...
请
注册
或
登录
后发表评论