Skip to content

Commit

Permalink
对flvPacker.encodeFlv做判空保护
Browse files Browse the repository at this point in the history
Change-Id: I30bc1f943745a6e28fc3b286716d329860a4d7ac
  • Loading branch information
SundoggyNew committed Jun 26, 2023
1 parent 08589ab commit 6d95b0e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ public void stop() {
executor.shutdown();
audioRecord = null;
pcmEncoder = null;
flvPacker.release();
flvPacker = null;
if (flvPacker != null) {
flvPacker.release();
flvPacker = null;
}
if (canceler != null) {
canceler.setEnabled(false);
canceler.release();
Expand Down Expand Up @@ -223,7 +225,9 @@ public void release() {

@Override
public void encodeAAC(byte[] data, long time) {
flvPacker.encodeFlv(data, FLVPacker.TYPE_AUDIO, System.currentTimeMillis());
if (flvPacker != null && data != null && data.length != 0) {
flvPacker.encodeFlv(data, FLVPacker.TYPE_AUDIO, System.currentTimeMillis());
}
}

@Override
Expand Down

0 comments on commit 6d95b0e

Please sign in to comment.