diff --git a/src/audio.c b/src/audio.c index 7da740f..ca09ccd 100644 --- a/src/audio.c +++ b/src/audio.c @@ -71,19 +71,19 @@ int audio_destroy(audio_t *aud) { return -1; } - if ((pa_err = Pa_CloseStream(aud->stream_in)) != paNoError) { + if ((pa_err = Pa_CloseStream(aud->stream_in)) != paNoError && pa_err != paStreamIsStopped) { fprintf(stderr, "Cannot close an input PortAudio stream: %s\n", Pa_GetErrorText(pa_err)); return -1; } } if (aud->stream_out != NULL) { - if ((pa_err = Pa_StopStream(aud->stream_out)) != paNoError) { + if ((pa_err = Pa_StopStream(aud->stream_out)) != paNoError && pa_err != paStreamIsStopped) { fprintf(stderr, "Cannot stop an output PortAudio stream: %s\n", Pa_GetErrorText(pa_err)); return -1; } - if ((pa_err = Pa_CloseStream(aud->stream_out)) != paNoError) { + if ((pa_err = Pa_CloseStream(aud->stream_out)) != paNoError && pa_err != paStreamIsStopped) { fprintf(stderr, "Cannot close an output PortAudio stream: %s\n", Pa_GetErrorText(pa_err)); return -1; }