diff --git a/hairtunes.c b/hairtunes.c index 3f83f19f..5671c665 100644 --- a/hairtunes.c +++ b/hairtunes.c @@ -451,10 +451,17 @@ static void *rtp_thread_func(void *arg) { plen -= 12; // check if packet contains enough content to be reasonable - if (plen < 16) - continue; - - buffer_put_packet(seqno, pktp, plen); + if (plen >= 16) { + buffer_put_packet(seqno, pktp, plen); + } else { + // resync? + if (type == 0x56 && seqno == 0) { + fprintf(stderr, "Suspected resync request packet received. Initiating resync.\n"); + pthread_mutex_lock(&ab_mutex); + ab_resync(); + pthread_mutex_unlock(&ab_mutex); + } + } } }