netjack2: handle sync_wait errors

netjack2_driver_sync_wait can return an negative value on error, don't
do any processing in that case instead of wrapping around the negative
value into a huge unsigned int and breaking things..
This commit is contained in:
Wim Taymans 2026-04-29 13:56:11 +02:00
parent 3d414960c2
commit 739e2d1107

View file

@ -676,11 +676,11 @@ on_data_io(void *data, int fd, uint32_t mask)
}
if (mask & SPA_IO_IN) {
bool source_running, sink_running;
uint32_t nframes;
int32_t nframes;
uint64_t nsec;
nframes = netjack2_driver_sync_wait(&impl->peer);
if (nframes == 0)
if (nframes <= 0)
return;
nsec = get_time_nsec(impl);