Skip to content

Commit

Permalink
Initiating resync when receiving strange packet
Browse files Browse the repository at this point in the history
The packet type 0x56, sequence number 0, containing 4 bytes (the first two are the sequence number of the previously requested packet) initiates a resync. Not sure what this packet is supposed to do, but it occurs after heavy requesting resending of packets. Seems to be an out of sync situation, so resyncing is not the worst idea.

Signed-off-by: Gregor Fabritius <gre@g0r.de>
  • Loading branch information
grefab committed Jul 15, 2012
1 parent c4ec84d commit 643f57d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions hairtunes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}

Expand Down

0 comments on commit 643f57d

Please sign in to comment.