mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-01-03 14:15:47 +00:00
PulseAudio: implement pausing input streams
This commit is contained in:
parent
29dd765aa0
commit
f6684a0585
|
@ -238,9 +238,9 @@ view `coverage/index.html` in a browser.
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
|
0. ALSA: poll instead of callback
|
||||||
0. ALSA: support devices that don't support mmap access (test with pulseaudio alsa default)
|
0. ALSA: support devices that don't support mmap access (test with pulseaudio alsa default)
|
||||||
0. implement ALSA (Linux) backend, get examples working
|
0. implement ALSA (Linux) backend, get examples working
|
||||||
0. ALSA: poll instead of callback
|
|
||||||
0. pipe record to playback example working with dummy linux, osx, windows
|
0. pipe record to playback example working with dummy linux, osx, windows
|
||||||
0. pipe record to playback example working with pulseaudio linux
|
0. pipe record to playback example working with pulseaudio linux
|
||||||
0. implement CoreAudio (OSX) backend, get examples working
|
0. implement CoreAudio (OSX) backend, get examples working
|
||||||
|
|
|
@ -969,7 +969,21 @@ static void instream_clear_buffer_pa(SoundIoPrivate *si, SoundIoInStreamPrivate
|
||||||
}
|
}
|
||||||
|
|
||||||
static int instream_pause_pa(SoundIoPrivate *si, SoundIoInStreamPrivate *is, bool pause) {
|
static int instream_pause_pa(SoundIoPrivate *si, SoundIoInStreamPrivate *is, bool pause) {
|
||||||
soundio_panic("TODO");
|
SoundIoInStreamPulseAudio *ispa = (SoundIoInStreamPulseAudio *)is->backend_data;
|
||||||
|
SoundIoPulseAudio *sipa = (SoundIoPulseAudio *)si->backend_data;
|
||||||
|
|
||||||
|
pa_threaded_mainloop_lock(sipa->main_loop);
|
||||||
|
|
||||||
|
if (pause != !pa_stream_is_corked(ispa->stream)) {
|
||||||
|
pa_operation *op = pa_stream_cork(ispa->stream, pause, NULL, NULL);
|
||||||
|
if (!op)
|
||||||
|
return SoundIoErrorStreaming;
|
||||||
|
pa_operation_unref(op);
|
||||||
|
}
|
||||||
|
|
||||||
|
pa_threaded_mainloop_unlock(sipa->main_loop);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int soundio_pulseaudio_init(SoundIoPrivate *si) {
|
int soundio_pulseaudio_init(SoundIoPrivate *si) {
|
||||||
|
|
Loading…
Reference in a new issue