File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ void SoundServer::shutdown()
100100 case SND_SERVER_UP:
101101 /* fall through */
102102 case SND_API_READY:
103+ if (!impl->cubeb_ctx )
104+ break ;
103105 cubeb_destroy (impl->cubeb_ctx );
106+ impl->cubeb_ctx = nullptr ;
104107 break ;
105108 case SND_SERVER_DOWN:
106109 // Nothing to do.
107- break ;
110+ return ;
108111 }
109112
110113 impl->status = SND_SERVER_DOWN;
@@ -231,6 +234,8 @@ int SoundServer::start_out_stream()
231234
232235void SoundServer::close_out_stream ()
233236{
237+ if (!impl->out_stream )
238+ return ;
234239 if (is_deterministic) {
235240 LOG_F (9 , " Stopping sound output deterministic polling." );
236241 TimerManager::get_instance ()->cancel_timer (impl->deterministic_poll_timer );
@@ -239,6 +244,7 @@ void SoundServer::close_out_stream()
239244 }
240245 cubeb_stream_stop (impl->out_stream );
241246 cubeb_stream_destroy (impl->out_stream );
247+ impl->out_stream = nullptr ;
242248 impl->status = SND_STREAM_CLOSED;
243249 LOG_F (9 , " Sound output stream closed." );
244250}
You can’t perform that action at this time.
0 commit comments