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.
This commit is contained in:
Arun Raghavan 2024-06-20 10:57:33 -04:00
parent 6b6e9c4ea9
commit 8cd857733b

View file

@ -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;
}