[channels] Fix PulseAudio assertions/NULL checks

This commit is contained in:
akallabeth 2024-09-23 12:00:02 +02:00
parent ae3330d63d
commit 4b60f0651c
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
3 changed files with 6 additions and 2 deletions

View File

@ -292,6 +292,8 @@ static UINT audin_pulse_set_format(IAudinDevice* device, const AUDIO_FORMAT* for
static void audin_pulse_stream_state_callback(pa_stream* stream, void* userdata)
{
AudinPulseDevice* pulse = (AudinPulseDevice*)userdata;
WINPR_ASSERT(pulse);
pa_stream_state_t state = pa_stream_get_state(stream);
WLog_Print(pulse->log, WLOG_DEBUG, "stream state %s", pulse_stream_state_string(state));
@ -408,7 +410,7 @@ static UINT audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
return pa_context_errno(pulse->context);
}
for (;;)
while (pulse->stream)
{
state = pa_stream_get_state(pulse->stream);

View File

@ -414,7 +414,7 @@ static BOOL rdpsnd_pulse_open_stream(rdpsndDevicePlugin* device)
return FALSE;
}
for (;;)
while (pulse->stream)
{
state = pa_stream_get_state(pulse->stream);

View File

@ -176,6 +176,8 @@ static void tsmf_pulse_wait_for_operation(TSMFPulseAudioDevice* pulse, pa_operat
static void tsmf_pulse_stream_state_callback(pa_stream* stream, void* userdata)
{
TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*)userdata;
WINPR_ASSERT(pulse);
pa_stream_state_t state = pa_stream_get_state(stream);
switch (state)