Calling Pa_CloseStream would result in a crash because of attempting to free an invalid ptr.
Pa_CloseStream would call pa_opensles.c's StopStream
This would in turn call PaUnixThread_Terminate which looks at the thread's returns value via pthread_join.
If the thread's return value is not 0, portaudio interprets there's a pointer to free.
However because StreamProcessingCallback never returns a value nor calls PaUnixThreading_EXIT, there's only garbage; causing a crash when attempting to free that garbage ptr.
Warnings fixed
Trying to build with a modern version of the NDK would give a couple:
portaudio_opensles/src/hostapi/opensles/pa_opensles.c:1146: warning: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Wimplicit-function-declaration]
memset( stream->outputBuffers[stream->currentOutputBuffer], 0,
^
Crash fixed
Calling Pa_CloseStream would result in a crash because of attempting to free an invalid ptr.
Pa_CloseStream would call pa_opensles.c's StopStream This would in turn call PaUnixThread_Terminate which looks at the thread's returns value via pthread_join.
If the thread's return value is not 0, portaudio interprets there's a pointer to free.
However because StreamProcessingCallback never returns a value nor calls PaUnixThreading_EXIT, there's only garbage; causing a crash when attempting to free that garbage ptr.
Warnings fixed
Trying to build with a modern version of the NDK would give a couple:
This PR fixes that warning