raop: Silently drop out-of-history retransmission request

This commit is contained in:
Hajime Fujita 2016-11-06 12:54:20 -06:00 committed by Tanu Kaskinen
parent 516906aef9
commit b81ceb6707

View file

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