             if (_data) {
                 _read_position = _data.position;
                 // finish reading TS fragment
-                if (_data_complete && _data.bytesAvailable < 188) {
+                if (_data_complete && _data.bytesAvailable < PACKETSIZE) {
                     // free ByteArray
                     _data = null;
                     // first check if TS parsing was successful

            var start_time : int = getTimer();
            _data.position = _read_position;
            // dont spend more than 20ms demuxing TS packets to avoid loosing frames
            while ((_data.bytesAvailable >= 188) && ((getTimer() - start_time) < 20)) {
                _parseTSPacket();
            }
            if (_tags.length) {

            return len + pointerField;
        };
    }
}
