Skip to content

Commit

Permalink
bug: 解决偶现无法再次播放问题 close #180
Browse files Browse the repository at this point in the history
  • Loading branch information
hexleo committed Dec 8, 2021
1 parent 873554f commit 042785c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ class AudioPlayer(val player: AnimPlayer) {
}

fun destroy() {
needDestroy = true
if (isRunning) {
needDestroy = true
stop()
} else {
destroyInner()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,16 @@ class HardDecoder(player: AnimPlayer) : Decoder(player), SurfaceTexture.OnFrameA
}

override fun destroy() {
needDestroy = true
if (isRunning) {
needDestroy = true
stop()
} else {
destroyInner()
}
}

private fun destroyInner() {
ALog.i(TAG, "destroyInner")
renderThread.handler?.post {
player.pluginManager.onDestroy()
render?.destroyRender()
Expand Down

0 comments on commit 042785c

Please sign in to comment.