     packets = []
     while bits.has_more_data()
       packet = {}
-      packet.payloadValue = bits.get_byte_at 1
-      switch packet.payloadValue
+      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

    info.wordsMinusOne = bits.read_bits 16
    info.totalBytes = (info.wordsMinusOne + 1) * 4
    info.ssrc = bits.read_bits 32
    info.ntpTimestamp = bits.read_bits 64  # loses some precision
    info.rtpTimestamp = bits.read_bits 32
    info.senderPacketCount = bits.read_bits 32
    info.senderOctetCount = bits.read_bits 32

      octetCount & 0xff,
    ]

  # Parse config parameter for AAC
  # see: RFC 3640, 4.1. MIME Type Registration
  parseAACConfig: (str) ->
    if str is '""'  # empty string
      return null
    buf = new Buffer str, 'hex'
    return aac.parseAudioSpecificConfig buf

module.exports = api
