Skip to content

Commit

Permalink
添加player.get非空判断
Browse files Browse the repository at this point in the history
Change-Id: I34c3a834e723cdf2750165b6bc030b44963e81d9
  • Loading branch information
SundoggyNew committed Nov 24, 2023
1 parent 310a4cc commit a87630c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,12 @@ private class WriteThread extends Thread {
@Override
public void run() {
while (recorderState) {
if (player != null && player.get().isPlaying()) {
if (player != null && player.get() != null && player.get().isPlaying()) {
byte[] data = new byte[204800];
int len = player.get()._getPcmData(data);
int len = 0;
if (player != null && player.get() != null) {
len = player.get()._getPcmData(data);
}
if (len > 0) {
byte[] playerBytes = new byte[len];
System.arraycopy(data, 0, playerBytes, 0, len);
Expand Down

0 comments on commit a87630c

Please sign in to comment.