From 8cd857733b78d3f5dd44d6be2e03bcc1901f8885 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 20 Jun 2024 10:57:33 -0400 Subject: [PATCH] module-rtp: Check if packet receive works to track receiving state If the sender is reset, the RTP stream may return, but may no longer correspond to the stream for which we loaded this instance of module-rtp-source. A power cycle or network reset on Dante devices causes a new SDP and SSRC to be selected, for example. So let's make sure we don't consider invalid receives while tracking our "receiving" state. Arguable, we should bail entirely if this happens. --- src/modules/module-rtp-source.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-rtp-source.c b/src/modules/module-rtp-source.c index 006f396c4..e37a9df9b 100644 --- a/src/modules/module-rtp-source.c +++ b/src/modules/module-rtp-source.c @@ -182,8 +182,10 @@ on_rtp_io(void *data, int fd, uint32_t mask) if (len < 12) goto short_packet; - if (SPA_LIKELY(impl->stream)) - rtp_stream_receive_packet(impl->stream, buffer, len); + if (SPA_LIKELY(impl->stream)) { + if (rtp_stream_receive_packet(impl->stream, buffer, len) < 0) + goto receive_error; + } impl->receiving = true; }