cleanup initial audio sync; now use 64-bit rpt time to avoid epoch issues

This commit is contained in:
fduncanh
2022-06-13 18:06:45 -04:00
parent 1a01a4694b
commit cf89f4b7d2
4 changed files with 101 additions and 87 deletions

View File

@@ -207,7 +207,7 @@ raop_buffer_decrypt(raop_buffer_t *raop_buffer, unsigned char *data, unsigned ch
}
int
raop_buffer_enqueue(raop_buffer_t *raop_buffer, unsigned char *data, unsigned short datalen, int use_seqnum) {
raop_buffer_enqueue(raop_buffer_t *raop_buffer, unsigned char *data, unsigned short datalen, uint64_t timestamp, int use_seqnum) {
unsigned char empty_packet_marker[] = { 0x00, 0x68, 0x34, 0x00 };
assert(raop_buffer);
@@ -248,7 +248,7 @@ raop_buffer_enqueue(raop_buffer_t *raop_buffer, unsigned char *data, unsigned sh
/* Update the raop_buffer entry header */
entry->seqnum = seqnum;
entry->timestamp = byteutils_get_int_be(data, 4);
entry->timestamp = timestamp;
entry->filled = 1;
entry->payload_data = malloc(payload_size);
@@ -269,7 +269,7 @@ raop_buffer_enqueue(raop_buffer_t *raop_buffer, unsigned char *data, unsigned sh
}
void *
raop_buffer_dequeue(raop_buffer_t *raop_buffer, unsigned int *length, uint32_t *timestamp, unsigned short *seqnum, int no_resend) {
raop_buffer_dequeue(raop_buffer_t *raop_buffer, unsigned int *length, uint64_t *timestamp, unsigned short *seqnum, int no_resend) {
assert(raop_buffer);
/* Calculate number of entries in the current buffer */