File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,6 @@ SoundDeviceStatus SoundDevicePortAudio::close() {
461461 if (err < 0 ) {
462462 qWarning () << " PortAudio: Pa_IsStreamStopped returned error:"
463463 << Pa_GetErrorText (err) << m_deviceId;
464- return SoundDeviceStatus::Error;
465464 }
466465 if (err == 1 ) {
467466 qWarning () << " PortAudio: Stream already stopped" ;
@@ -472,24 +471,23 @@ SoundDeviceStatus SoundDevicePortAudio::close() {
472471
473472 // We can now safely call Pa_StopStream, which should not block as the
474473 // stream has become inactive.
475- err = Pa_StopStream (m_pStream );
474+ err = Pa_StopStream (pStream );
476475 if (err != paNoError) {
477476 qWarning () << " PortAudio: Stop stream error:"
478477 << Pa_GetErrorText (err) << m_deviceId;
479- return SoundDeviceStatus::Error;
480478 }
481479 }
482480
483- // We can now safely set m_pStream to null
484- m_pStream.store (nullptr , std::memory_order_release);
485-
486481 // Close stream
487482 err = Pa_CloseStream (pStream);
488483 if (err != paNoError) {
489484 qWarning () << " PortAudio: Close stream error:"
490485 << Pa_GetErrorText (err) << m_deviceId;
491486 return SoundDeviceStatus::Error;
492487 }
488+
489+ // We can now safely set m_pStream to null
490+ m_pStream.store (nullptr , std::memory_order_release);
493491 }
494492
495493 m_outputFifo.reset ();
You can’t perform that action at this time.
0 commit comments