Skip to content

Commit

Permalink
fix: Fixed crash caused by missing projection handle
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Oct 24, 2022
1 parent a1e4d72 commit 82f921d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,13 @@ class RootlessAudioProcessorService : BaseAudioProcessorService() {
track.stop()
recorder.release()


if (mediaProjection == null) {
Timber.e("Media projection handle is null, stopping service")
stopSelf()
return@Thread
}

// Recreate recorder with new AudioPlaybackRecordingConfiguration
recorder = buildAudioRecord(encodingFormat, sampleRate, bufferSizeBytes)
Timber.d("Recorder recreated")
Expand Down

0 comments on commit 82f921d

Please sign in to comment.