       ]
     , @chunkSize
 
+    @stream.startPublish()
     @emit "stream_published", @stream
 
     callback null, publishStart

        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 

      if msgs.length > 1
        buf = createRTMPAggregateMessage msgs, session.chunkSize

        avcprofile: config.flv_params.avcprofile
        videocodecid: config.flv_params.videocodecid
        audiocodecid: config.flv_params.audiocodecid

    # delete streams[stream]
    # spsPacket = null
    # ppsPacket = null
