aboutsummaryrefslogtreecommitdiffstats
path: root/airtunes2.rst
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2010-08-07 20:22:08 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2010-08-07 20:22:23 +0200
commit18a62f164c7cceaaca3247ec1fb3a6b816f73683 (patch)
tree215302e3b8b8da1eef398625e2b534ef6755c745 /airtunes2.rst
parentSmall clarifications in RTSP description (diff)
downloadAirtunes2-18a62f164c7cceaaca3247ec1fb3a6b816f73683.tar.xz
Airtunes2-18a62f164c7cceaaca3247ec1fb3a6b816f73683.zip
Update sync info.
Diffstat (limited to 'airtunes2.rst')
-rw-r--r--airtunes2.rst26
1 files changed, 13 insertions, 13 deletions
diff --git a/airtunes2.rst b/airtunes2.rst
index d21e18a..b43b106 100644
--- a/airtunes2.rst
+++ b/airtunes2.rst
@@ -168,8 +168,8 @@ This is an NTP Timestamp as described in RFC 3450 Section 4. and RFC 1305
::
- /* sizeof(RtpTime) == 8 */
- struct RtpTime {
+ /* sizeof(NtpTime) == 8 */
+ struct NtpTime {
/* Seconds since 1900-01-01 00:00:00 (TODO: Timezone?) */
uint32_t integer;
@@ -209,9 +209,9 @@ SyncPacket
/* sizeof(SyncPacket) == 20 */
struct SyncPacket {
RtpHeader header;
- RtpTimestamp timestamp;
- NtpTime some_time;
- RtpTimestamp next_timestamp;
+ RtpTimestamp now_minus_latency;
+ NtpTime time_last_sync;
+ RtpTimestamp now;
}
@@ -502,17 +502,17 @@ Sync
----
Sync packets are sent once per second or when adding a speaker. They are sent
-to the device control port as UDP packets. The next_timestamp field corresponds
-to the RTP timestamp of the next audio packet that will be sent.
+to the device control port as UDP packets. The timestamp argument corresponds
+to the RTP timestamp of the next audio packet that will be sent. The latency
+argument is gathered from the Audio-Latency RTSP header.
-TODO: More details such as timing adjustments.
Sending sync packet
~~~~~~~~~~~~~~~~~~~
::
- send_sync(uint32_t timestamp, bool first) {
+ send_sync(uint32_t timestamp, uint32_t latency, bool first) {
SyncPacket packet;
packet.header.payload_type = PAYLOAD_SYNC;
packet.header.marker = True;
@@ -521,10 +521,10 @@ Sending sync packet
if (first) {
packet.header.extension = True;
}
-
- packet.now_timestamp = /* TODO: RTP timestamp taking into account latency? */;
- packet.next_timestamp = current_rtp_timestamp; /* RTP Timestamp that will be used for the next RTP audio packet */
- packet.some_time = /* TODO: an NTP timestamp */
+
+ packet.now_minus_latency = timestamp - latency;
+ packet.now = timestamp;
+ packet.time_last_sync = time_of_last_sync_packet;
}