mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-05 04:06:37 -05:00
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:
parent
a16485f8aa
commit
e874f705a9
1 changed files with 4 additions and 0 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue