         @connected      = false
         @framesPerSec   = null
         
+        @emit_duration  = 0.5
+        
+        @_chunk_queue = []
+        
         @log = @stream.log
+        
+        @last_header = null
         
         # connection drop handling
         @_maxBounces    = 10

            @log.debug "Lost connection to #{@url}. Retrying in 5 seconds"
            @connected = false
            
        @stream.on "data", (chunk) =>
            #console.log "#{@key} got data chunk"
            @emit "data", chunk

        @stream.on "metadata", (data) =>
            meta = Icecast.parseMetadata(data)
            

                
                @stream_key = ['mp3',header.samplingRateHz,header.bitrateKBPS,(if header.modeName == "Stereo" then "s" else "m")].join("-")
                
            @last_header = data
            @emit "header", data, header

        # return with success
