mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-11 05:29:43 +00:00
soundserver: shut-down safely.
This commit is contained in:
parent
c37893847a
commit
5e6f3a51b5
@ -46,14 +46,6 @@ AwacsBase::AwacsBase()
|
||||
this->out_stream_ready = false;
|
||||
}
|
||||
|
||||
AwacsBase::~AwacsBase()
|
||||
{
|
||||
// disconnect from SoundServer
|
||||
if (this->out_stream_ready) {
|
||||
snd_server->close_out_stream();
|
||||
}
|
||||
}
|
||||
|
||||
void AwacsBase::set_sample_rate(int sr_id)
|
||||
{
|
||||
if (sr_id > this->max_sr_id) {
|
||||
|
@ -40,7 +40,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
class AwacsBase {
|
||||
public:
|
||||
AwacsBase();
|
||||
~AwacsBase();
|
||||
~AwacsBase() = default;
|
||||
|
||||
void set_dma_out(DmaOutChannel *dma_out_ch) {
|
||||
this->dma_out_ch = dma_out_ch;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
DingusPPC - The Experimental PowerPC Macintosh emulator
|
||||
Copyright (C) 2018-21 divingkatae and maximum
|
||||
Copyright (C) 2018-22 divingkatae and maximum
|
||||
(theweirdo) spatium
|
||||
|
||||
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
||||
@ -114,8 +114,10 @@ int SoundServer::start()
|
||||
void SoundServer::shutdown()
|
||||
{
|
||||
switch (this->status) {
|
||||
case SND_STREAM_OPENED:
|
||||
close_out_stream();
|
||||
/* fall through */
|
||||
case SND_SERVER_UP:
|
||||
//soundio_device_unref(this->out_device);
|
||||
/* fall through */
|
||||
case SND_API_READY:
|
||||
cubeb_destroy(this->cubeb_ctx);
|
||||
@ -203,6 +205,8 @@ int SoundServer::open_out_stream(uint32_t sample_rate, void *user_data)
|
||||
|
||||
LOG_F(INFO, "Sound output stream opened.");
|
||||
|
||||
this->status = SND_STREAM_OPENED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@ enum {
|
||||
SND_SERVER_DOWN = 0,
|
||||
SND_API_READY,
|
||||
SND_SERVER_UP,
|
||||
SND_STREAM_OPENED
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user