         console.log "metadata re-sent"
 
       for rtmpMessage in msgs
-        session.lastTimestamp[rtmpMessage.avType] = rtmpMessage.timestamp = session.offsetTimestamp[rtmpMessage.avType] + session.getScaledTimestamp(rtmpMessage.originalTimestamp) % TIMESTAMP_ROUNDOFF 
+        session.lastTimestamp[rtmpMessage.avType] = rtmpMessage.timestamp = session.offsetTimestamp[rtmpMessage.avType] + session.getScaledTimestamp(rtmpMessage.originalTimestamp) % TIMESTAMP_ROUNDOFF
 
       if msgs.length > 1
         buf = createRTMPAggregateMessage msgs, session.chunkSize


module.exports = RTMPServer
module.exports.streams = streams



streams = { }

class Stream
  constructor: (name, fileName) ->
    @name = name

  startPublish: () ->
    timestamp = new Date().getTime()
    dumpFileName = "rtmp-dump-" + @name + "-" + timestamp + ".stream_dump"
    dumpFileRoot = process.env.CAM_STREAM_DUMP_ROOT_PATH || "/tmp/"
    dumpFilePath = path.join(dumpFileRoot, dumpFileName)
    console.log "Dumping to " + dumpFilePath
    if @dump then @dump.end()
    @dump = fs.createWriteStream(dumpFilePath)

getStreamByName = (name) ->
  if (name == 'broadcast')
