[client] audiodevs/pipewire: implement proper recording stop/restart

Before, pipewire_recordStop did nothing since pw.record.active was
always false.
This commit is contained in:
Quantum 2022-03-18 01:53:06 -04:00 committed by Geoffrey McRae
parent 75370e464d
commit fb5a71c47e

View File

@ -426,7 +426,16 @@ static void pipewire_recordStart(int channels, int sampleRate,
if (pw.record.stream && if (pw.record.stream &&
pw.record.channels == channels && pw.record.channels == channels &&
pw.record.sampleRate == sampleRate) pw.record.sampleRate == sampleRate)
{
if (!pw.record.active)
{
pw_thread_loop_lock(pw.thread);
pw_stream_set_active(pw.record.stream, true);
pw.record.active = true;
pw_thread_loop_unlock(pw.thread);
}
return; return;
}
pipewire_recordStopStream(); pipewire_recordStopStream();
@ -474,6 +483,7 @@ static void pipewire_recordStart(int channels, int sampleRate,
params, 1); params, 1);
pw_thread_loop_unlock(pw.thread); pw_thread_loop_unlock(pw.thread);
pw.record.active = true;
} }
static void pipewire_recordStop(void) static void pipewire_recordStop(void)