[pulseaudio-discuss] [PATCH v6 30/37] raop: Silently drop out-of-history retransmission request

Hajime Fujita crisp.fujita at gmail.com
Sun Jan 31 20:16:27 PST 2016


From: Hajime Fujita <crisp.fujita at nifty.com>

---
 src/modules/raop/raop-packet-buffer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/modules/raop/raop-packet-buffer.c b/src/modules/raop/raop-packet-buffer.c
index 05f9592..72fd729 100644
--- a/src/modules/raop/raop-packet-buffer.c
+++ b/src/modules/raop/raop-packet-buffer.c
@@ -142,13 +142,15 @@ pa_memchunk *pa_raop_packet_buffer_retrieve(pa_raop_packet_buffer *pb, uint16_t
         if (seq < pb->seq) {
             /* Regular case: pb->seq did not wrapped since seq. */
             delta = pb->seq - seq;
-            pa_assert(delta <= pb->count);
         } else {
             /* Tricky case: pb->seq wrapped since seq! */
             delta = pb->seq + (UINT16_MAX - seq);
-            pa_assert(delta <= pb->count);
         }
 
+        /* If the requested packet is too old, do nothing and return */
+        if (delta > pb->count)
+            return NULL;
+
         i = (pb->size + pb->pos - delta) % pb->size;
 
         if (delta < pb->size && pb->packets[i].memblock)
-- 
2.5.0



More information about the pulseaudio-discuss mailing list