mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-01-09 00:25:38 +00:00
parent
7b2a10f7e5
commit
760aee2e54
|
@ -426,6 +426,8 @@ static int outstream_open_jack(struct SoundIoPrivate *si, struct SoundIoOutStrea
|
||||||
SoundIoDevicePrivate *dev = (SoundIoDevicePrivate *)device;
|
SoundIoDevicePrivate *dev = (SoundIoDevicePrivate *)device;
|
||||||
SoundIoDeviceJack *dj = &dev->backend_data.jack;
|
SoundIoDeviceJack *dj = &dev->backend_data.jack;
|
||||||
|
|
||||||
|
osj->is_paused = true;
|
||||||
|
|
||||||
if (sij->is_shutdown)
|
if (sij->is_shutdown)
|
||||||
return SoundIoErrorBackendDisconnected;
|
return SoundIoErrorBackendDisconnected;
|
||||||
|
|
||||||
|
@ -516,9 +518,13 @@ static int outstream_pause_jack(struct SoundIoPrivate *si, struct SoundIoOutStre
|
||||||
|
|
||||||
int err;
|
int err;
|
||||||
if (pause) {
|
if (pause) {
|
||||||
|
if (!osj->is_paused) {
|
||||||
if ((err = jack_deactivate(osj->client)))
|
if ((err = jack_deactivate(osj->client)))
|
||||||
return SoundIoErrorStreaming;
|
return SoundIoErrorStreaming;
|
||||||
|
osj->is_paused = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (osj->is_paused) {
|
||||||
if ((err = jack_activate(osj->client)))
|
if ((err = jack_activate(osj->client)))
|
||||||
return SoundIoErrorStreaming;
|
return SoundIoErrorStreaming;
|
||||||
|
|
||||||
|
@ -532,6 +538,8 @@ static int outstream_pause_jack(struct SoundIoPrivate *si, struct SoundIoOutStre
|
||||||
if ((err = jack_connect(osj->client, source_port_name, dest_port_name)))
|
if ((err = jack_connect(osj->client, source_port_name, dest_port_name)))
|
||||||
return SoundIoErrorStreaming;
|
return SoundIoErrorStreaming;
|
||||||
}
|
}
|
||||||
|
osj->is_paused = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -48,6 +48,7 @@ struct SoundIoOutStreamJack {
|
||||||
jack_client_t *client;
|
jack_client_t *client;
|
||||||
int period_size;
|
int period_size;
|
||||||
int frames_left;
|
int frames_left;
|
||||||
|
bool is_paused;
|
||||||
SoundIoOutStreamJackPort ports[SOUNDIO_MAX_CHANNELS];
|
SoundIoOutStreamJackPort ports[SOUNDIO_MAX_CHANNELS];
|
||||||
SoundIoChannelArea areas[SOUNDIO_MAX_CHANNELS];
|
SoundIoChannelArea areas[SOUNDIO_MAX_CHANNELS];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue