From 1417cd6f51ee54d42c9c1316ac387c4052ef426a Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 1 Dec 2025 11:15:25 +0000 Subject: [PATCH 1/2] When a new buffered audio processor is created, ensure any old flush requests are removed first. --- rtp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rtp.c b/rtp.c index e763f2d9..b8bfe9c7 100644 --- a/rtp.c +++ b/rtp.c @@ -2373,6 +2373,15 @@ void *rtp_buffered_audio_processor(void *arg) { conn->incoming_ssrc = 0; // reset conn->resampler_ssrc = 0; + + // turn off all flush requests that might have been pending in the connection. Not sure if this is right... + unsigned int fr = 0; + for (fr = 0; fr < MAX_DEFERRED_FLUSH_REQUESTS; fr++) { + conn->ap2_deferred_flush_requests[fr].inUse = 0; + conn->ap2_deferred_flush_requests[fr].active = 0; + } + conn->ap2_immediate_flush_requested = 0; + pthread_cleanup_push(rtp_buffered_audio_cleanup_handler, arg); pthread_t *buffered_reader_thread = malloc(sizeof(pthread_t)); From b64d0c98139ceec8858d5df80a79486b1a497e86 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 1 Dec 2025 11:18:54 +0000 Subject: [PATCH 2/2] Update release notes for version 5.0-dev-93 Added a bug fix for flushing requests in new play sessions. --- RELEASENOTES-DEVELOPMENT.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RELEASENOTES-DEVELOPMENT.md b/RELEASENOTES-DEVELOPMENT.md index 93180a07..27b82ede 100644 --- a/RELEASENOTES-DEVELOPMENT.md +++ b/RELEASENOTES-DEVELOPMENT.md @@ -1,3 +1,8 @@ +Version 5.0-dev-93-g1417cd6f +== +**Bug Fix** +* Ensure old flush requests are deleted when a new play session starts. Thanks to [saujanyashah](https://github.com/saujanyashah) for the [report](https://github.com/mikebrady/shairport-sync/issues/2107). + Version 5.0-dev-87-ge12a3ed7 == **Updates -- This is Significant**