     buf[11] = ssrc & 0xff
     return
 
+  # ntpTimestamp: [ <32-bit second part>, <32-bit fractional second part> ]
+  ntpTimestampToTime: (ntpTimestamp) ->
+    sec = ntpTimestamp[0] - EPOCH
+    ms = ntpTimestamp[1] / NTP_SCALE_FRAC / 1000
+    return sec * 1000 + ms
+
   # Get NTP timestamp for a time
   # time is expressed the same as Date.now()
   getNTPTimestamp: (time) ->

  RTCP_PACKET_TYPE_SOURCE_DESCRIPTION : 202  # SDES
  RTCP_PACKET_TYPE_GOODBYE            : 203  # BYE
  RTCP_PACKET_TYPE_APPLICATION_DEFINED: 204  # APP

  readRTCPSenderReport: ->
    # RFC 3550 - 6.4.1 SR: Sender Report RTCP Packet

    packets = []
    while bits.has_more_data()
      packet = {}
      payloadValue = bits.get_byte_at 1  # including marker bit
      switch payloadValue
        when api.RTCP_PACKET_TYPE_SENDER_REPORT
          packet.rtcpSenderReport = api.readRTCPSenderReport()
        when api.RTCP_PACKET_TYPE_RECEIVER_REPORT
