module-rtp: clear ringbuffer when stream stops to prevent old packets

Clear the ringbuffer in stream_stop() when processing stops to prevent old invalid packets
from being sent when processing resumes via rtp_audio_flush_packets().

This ensures a clean state when the stream restarts.
This commit is contained in:
Stanislav Ruzani 2025-12-27 18:37:33 +01:00 committed by Carlos Rafael Giani
parent a16485f8aa
commit e874f705a9

View file

@ -454,6 +454,10 @@ static int stream_stop(struct impl *impl)
* meaning that the timer was no longer running, and the connection
* could be closed. */
if (!timer_running) {
/* Clear the ringbuffer to prevent old invalid packets from being
* sent when processing resumes via rtp_audio_flush_packets() */
if (impl->reset_ringbuffer)
impl->reset_ringbuffer(impl);
set_internal_stream_state(impl, RTP_STREAM_INTERNAL_STATE_STOPPED);
pw_log_info("stream stopped");
}