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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hajime Fujita <crisp.fujita@xxxxxxxxx>

---
 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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux