libpulseaudio: do not stop if we are going to close aaudio stream

Apparently it's safer if we don't:
https://android.googlesource.com/platform/frameworks/av/+/refs/heads/oreo-release/media/libaaudio/src/client/AudioStreamInternal.cpp#182
This commit is contained in:
Tom Yan 2019-03-06 18:12:04 +08:00
parent 64980864da
commit 88af57a51b
1 changed files with 2 additions and 1 deletions

View File

@ -241,9 +241,10 @@ static int state_func_io(pa_sink *s, pa_sink_state_t state, pa_suspend_cause_t s
if ((PA_SINK_IS_OPENED(s->thread_info.state) && state == PA_SINK_SUSPENDED) ||
(PA_SINK_IS_LINKED(s->thread_info.state) && state == PA_SINK_UNLINKED)) {
AAudioStream_requestStop(u->stream);
if (!u->no_close)
AAudioStream_close(u->stream);
else
AAudioStream_requestStop(u->stream);
} else if (s->thread_info.state == PA_SINK_SUSPENDED && PA_SINK_IS_OPENED(state)) {
if (AAudioStream_requestStart(u->stream) < 0)
pa_log("AAudioStream_requestStart() failed.");