     }
 
     private function sendSetupReq(block:Object):void {
+      state = STATE_SETUP;
       var interleavedChannels:String = interleaveChannelIndex++ + "-" + interleaveChannelIndex++;
       var p:String = url.isAbsolute(block.control) ? block.control : contentBase + block.control;
 

  public class RTSPClient extends EventDispatcher {
    private static var userAgent:String = "Slush 0.1";

    private static var STATE_INITIAL:uint       = 1<<0;
    private static var STATE_OPTIONS_SENT:uint  = 1<<1;
    private static var STATE_OPTIONS_RCVD:uint  = 1<<2;
    private static var STATE_DESCRIBE_SENT:uint = 1<<3;
    private static var STATE_DESCRIBE_RCVD:uint = 1<<4;
    private static var STATE_SETUP:uint         = 1<<5;
    private static var STATE_PLAY_SENT:uint     = 1<<6;
    private static var STATE_PLAYING:uint       = 1<<7;
    private static var STATE_PAUSE_SENT:uint    = 1<<8;
    private static var STATE_PAUSED:uint        = 1<<9;
    private static var STATE_TEARDOWN_SENT:uint = 1<<10;
    private static var STATE_TEARDOWN_RCVD:uint = 1<<11;

    private var state:int = STATE_INITIAL;

    private var handle:IRTSPHandle;

    private var sdp:SDP;
    private var flvmux:FLVMux;
    private var analu:ANALU;
    private var aaac:AAAC;

    private var urlParsed:Object;
    private var cSeq:uint = 1;

    private var contentBase:String;
    private var interleaveChannelIndex:uint = 0;

    private var methods:Array = [];
    private var data:ByteArray = new ByteArray();
    private var rtpLength:int = -1;
